CVE Professor
/
All CVEs
CVE-2026-120103

CVE-2026-120103 — DotCMS (26.10.28-02) — CWE-863

HIGH CVSS 8.7 NVD

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.

CVSS v4.0 Vector Metrics
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Attack Vector Network AV:N
Attack Complexity Low AC:L
Attack Reqs. None AT:N
Privileges Req. Low PR:L
User Interaction None UI:N
Vuln. Conf. High VC:H
Vuln. Integrity High VI:H
Vuln. Avail. High VA:H
Subseq. Conf. None SC:N
Subseq. Integ. None SI:N
Subseq. Avail. None SA:N
Scope X S:X
AI Security Analysis & Remediation

🎯 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 dotCMS via X-Powered-By headers, 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 the dotcms version 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

  • Privilege Escalation: The attacker's session now has the permissions of the CMS Administrator.
  • Full Control: The attacker can now:
  • * Access all content, including private or draft pages. * Modify site configuration, themes, and global settings. * Create new administrator accounts. * Deploy malicious VTL code to achieve Remote Code Execution (RCE) if the Velocity engine allows Java object instantiation (e.g., #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:

  • Confidentiality (High): An attacker can read all content, user data, and configuration files stored in the CMS.
  • Integrity (High): An attacker can modify any content, configuration, or code within the CMS, potentially defacing the site or injecting malicious scripts.
  • Availability (High): An attacker can delete critical content, disable the site, or corrupt the database, leading to a denial of service.
  • Scope (Unchanged): The impact is contained to the vulnerable CMS component, but since the CMS often serves as the primary web interface, the impact is severe for the entire web application.
  • Practical Consequences:

  • Complete Site Takeover: The attacker gains full administrative control over the website.

  • Data Breach: Sensitive data (user emails, internal documents, API keys) stored in the CMS can be exfiltrated.

  • Supply Chain Risk: If the CMS is used to generate content for other applications or if the attacker can modify VTL to execute server-side code, the compromise can extend to the underlying server.
  • 🛡️ Remediation & Mitigation

    1. Patching (Primary Solution)

  • Upgrade: Immediately upgrade dotCMS to version 26.10.28-02 or later.
  • Verification: After upgrading, verify that the 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)

  • Restrict VTL Execution: If possible, disable Velocity template execution for non-administrative users. This is difficult in dotCMS as VTL is core to its functionality, but you can:
  • * Remove authoring permissions from users who do not strictly need them. * Use a WAF to block requests to /api/v1/users/logoutas from non-administrative IP ranges or user agents (if feasible).
  • Network Segmentation: Restrict access to the /api/v1/users/logoutas endpoint to only trusted internal networks or specific administrative subnets using firewall rules.
  • Disable "Login As" Feature: If the "Login As" feature is not critical, consider disabling it at the configuration level (if such an option exists in dotCMS properties) to remove the attack surface.
  • 3. Detection (IoCs)

  • Web Server Logs: Monitor for POST requests to /api/v1/users/logoutas from user accounts that do not have the "Login As" role.
  • Example Log Pattern:* POST /api/v1/users/logoutas HTTP/1.1 with a User-Agent or Cookie associated with a non-admin user.
  • Application Logs: Look for session attribute changes related to loginas or impersonation that are not preceded by a legitimate "Login As" initiation from the admin UI.
  • VTL Execution Logs: Monitor for VTL code that contains setAttribute calls with keys related to user identity or session state.
  • Example:* $session.setAttribute("...loginas...")

    ⚠️ Urgency

  • CVSS Score: 8.7 (High)
  • CISA KEV: No (Not currently listed in the Known Exploited Vulnerabilities catalog, but this does not mean it is not being exploited in the wild).
  • Exploit Complexity: Low (AC:L). The attack requires only a valid authenticated user with authoring rights, which is a common role in CMS environments.
  • Priority: Critical / Immediate.
* Given the high impact (full admin takeover) and low complexity, this vulnerability should be treated as Critical for any internet-facing 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]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="dotCMS dotCMS"
CVSS Score
8.7 / 10 · CVSS HIGH
Weakness Types (CWE)
Affected Products (1)
dotCMS:dotCMS (26.10.28-02)
References & Advisories (1)
Related CVEs
9.4
CVE-2026-115523
Improper authorization in the legacy push-publishing endpoint and environment management actions, combined wit
9.4
CVE-2026-64883
Path traversal in the WebDAV interface (DotWebdavHelper and the WebDAV temporary-file COPY and MOVE handling)
9.4
CVE-2026-64884
An incomplete restricted-class check in the Velocity template sandbox (SecureIntrospectorImpl) in dotCMS versi
9.4
CVE-2026-126099
The Velocity template sandbox (SecureIntrospectorImpl) in dotCMS through 26.11.03-01, and in the 25.07 LTS lin
10.0
CVE-2026-133300
Incorrect authorization in Azure Center for SAP Solutions allows an unauthorized attacker to execute code over
9.8
CVE-2026-139934
Microsoft Azure API Management contains an incorrect authorization vulnerability that allows an unauthenticate
9.4
CVE-2026-68548
## Summary Algernon's URL-prefix authorization gate matches its protected prefixes (`/admin`, `/repo`, `/data`