CVE-2026-120103 — DotCMS (26.10.28-02) — CWE-863
Improper authorization in the Logout As REST endpoint (/api/v1/users/logoutas), combined with insufficient restrictions on the session attributes that Velocity code can write, in dotCMS versions before 26.10.28-02 allows an authenticated backend user who can author Velocity that renders in their own session (for example widget code, containers, templates or VTL files) to switch their session to any user, including a CMS Administrator, without holding the Login As role or knowing that user's password. Fixed in 26.10.28-02 and later. Logout As now restores a user only from an active Login As session record that Velocity code cannot create or change.
Improper authorization in the Logout As REST endpoint (/api/v1/users/logoutas), combined with insufficient restrictions on the session attributes that Velocity code can write, in dotCMS versions before 26.10.28-02 allows an authenticated backend user who can author Velocity that renders in their own session (for example widget code, containers, templates or VTL files) to switch their session to any user, including a CMS Administrator, without holding the Login As role or knowing that user's password. Fixed in 26.10.28-02 and later. Logout As now restores a user only from an active Login As session record that Velocity code cannot create or change.
🎯 What is this vulnerability?
This vulnerability is a Broken Access Control (CWE-863) flaw in the dotCMS Content Management System, specifically within the /api/v1/users/logoutas REST endpoint.
The core technical failure lies in the improper authorization logic combined with insufficient restriction on session attribute manipulation via Velocity Template Language (VTL).
1. The Flaw: The logoutas endpoint is intended to terminate a "Login As" session, allowing a user to revert to their original identity. However, the implementation fails to verify that the current session actually holds a valid, active "Login As" record that was established through the proper administrative workflow.
2. The Vector: In dotCMS, backend users with authoring privileges can execute Velocity code (VTL) within widgets, containers, templates, or VTL files. This code runs in the context of the user's session.
3. The Bypass: The vulnerability allows an authenticated user to manipulate session attributes directly via VTL. Because the logoutas endpoint trusts these session attributes to determine which user to "revert" to, an attacker can inject or modify the session state to claim they are currently "logged in as" a high-privilege user (e.g., a CMS Administrator).
4. The Result: When the attacker calls /api/v1/users/logoutas, the system accepts the manipulated session state, terminates the fake "Login As" session, and promotes the attacker's session to the target user's identity (the Administrator), effectively granting them full administrative privileges without knowing the admin's password or holding the specific "Login As" role.
Essentially, the endpoint treats the session's "current impersonation target" as a trusted source of truth, but VTL allows any author to write to that source of truth.
⚡ Attack Chain
1. Discovery & Reconnaissance
- Fingerprinting: Identify
dotCMSviaX-Powered-Byheaders, common asset paths (/dotcms/), or the presence of Velocity template artifacts in HTML responses. - Version Check: Determine if the version is prior to
26.10.28-02. This can often be done by checking thedotcmsversion in the footer, API responses, or by probing for version-specific endpoints. - Privilege Verification: The attacker needs a valid authenticated backend user account with the ability to author content that renders Velocity code (e.g., a "Contributor" or "Editor" role that can edit widgets or templates).
2. Exploitation
The attacker leverages their authoring rights to inject VTL code that manipulates the session attributes related to the "Login As" feature.Step 2a: Inject VTL Payload
The attacker edits a widget, template, or VTL file that they have permission to modify. They inject code that sets the session attribute indicating the current user is "logged in as" the Administrator.
Note: The exact session attribute name is not publicly disclosed in the CVE description. The following is an illustrative example based on typical dotCMS session management patterns where dotcms.loginas.user or similar keys might be used to track impersonation state.
# Illustrative VTL Payload (Syntax Valid for Velocity)
# This code attempts to set the session attribute that the 'logoutas' endpoint trusts.
# The actual attribute name may vary; this is a conceptual representation.
$session.setAttribute("dotcms.loginas.targetUserId", "[email protected]")
$session.setAttribute("dotcms.loginas.active", true)Alternatively, if the endpoint accepts a parameter to specify the user to logout as, the attacker might craft a request directly, but the CVE emphasizes the session attribute manipulation via VTL as the primary vector.
Step 2b: Trigger the Endpoint
After the VTL code has executed (triggered by viewing the page where the widget/template resides), the attacker calls the vulnerable endpoint.
# Illustrative cURL request
# The attacker uses their own valid session cookie (JSESSIONID or similar)
curl -X POST "https://target-dotcms-instance.com/api/v1/users/logoutas" \
-H "Cookie: JSESSIONID=ATTACKER_SESSION_ID" \
-H "Content-Type: application/json" \
-d '{}'Step 2c: Session Switch
The server processes the request. It reads the session attributes, sees that a "Login As" session is active for [email protected], and executes the logout logic. This logic switches the current session's identity to [email protected].
3. Post-Exploitation
#set($x = $runtime.exec("id"))), which is a common secondary risk in dotCMS VTL vulnerabilities.
* Exfiltrate sensitive data from the CMS database.🌍 Real World Impact
Based on the CVSS:4.0 Vector CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N:
Practical Consequences:
🛡️ Remediation & Mitigation
1. Patching (Primary Solution)
dotCMS to version 26.10.28-02 or later.logoutas endpoint no longer accepts session attributes manipulated by VTL. The fix ensures that the endpoint only restores a user from an active Login As session record that was created through the proper administrative UI, which Velocity code cannot create or modify.2. Workarounds (If Immediate Patching is Not Possible)
dotCMS as VTL is core to its functionality, but you can:/api/v1/users/logoutas from non-administrative IP ranges or user agents (if feasible).
/api/v1/users/logoutas endpoint to only trusted internal networks or specific administrative subnets using firewall rules.dotCMS properties) to remove the attack surface.3. Detection (IoCs)
/api/v1/users/logoutas from user accounts that do not have the "Login As" role.POST /api/v1/users/logoutas HTTP/1.1 with a User-Agent or Cookie associated with a non-admin user.
loginas or impersonation that are not preceded by a legitimate "Login As" initiation from the admin UI.setAttribute calls with keys related to user identity or session state.$session.setAttribute("...loginas...")⚠️ Urgency
dotCMS instance.
* Patching should be prioritized within 24-48 hours for production environments.
* If patching is delayed, implement the network segmentation and access restriction workarounds immediately.[🤖 CVE Professor AI Security Engine]
FOFA Query