CVE-2025-65961 Overview
CVE-2025-65961 is a cross-site scripting (XSS) vulnerability in Contao, an open-source content management system. The flaw affects Contao versions from 4.0.0 up to 4.13.57, 5.3.42, and 5.6.5. Attackers with high privileges can inject code into template output. The injected code executes in the browser across both the front-end and back-end of affected sites.
Contao maintainers patched the issue in versions 4.13.57, 5.3.42, and 5.6.5. The vulnerability is tracked under [CWE-79] (Improper Neutralization of Input During Web Page Generation) and [CWE-87] (Improper Neutralization of Alternate XSS Syntax).
Critical Impact
Authenticated attackers can execute arbitrary JavaScript in the browsers of front-end visitors and back-end administrators, enabling session hijacking and unauthorized actions in the CMS.
Affected Products
- Contao CMS versions 4.0.0 through 4.13.56
- Contao CMS versions 5.0.0 through 5.3.41
- Contao CMS versions 5.4.0 through 5.6.4
Discovery Timeline
- 2025-11-25 - CVE-2025-65961 published to the National Vulnerability Database
- 2026-06-17 - Last updated in the NVD database
Technical Details for CVE-2025-65961
Vulnerability Analysis
The vulnerability stems from insufficient output encoding in specific Contao templates. Template data reaches the rendered HTML without proper neutralization of scripting syntax. When a browser processes the resulting page, attacker-controlled markup executes as JavaScript in the user's session context.
Both front-end pages and the back-end administrative interface render the affected templates. This dual-surface exposure widens the impact from public visitors to authenticated administrators. A successful payload runs with the privileges of the viewing user.
Exploitation requires elevated privileges on the target Contao instance and user interaction to view the affected content. The scope changes because injected script executes in a browser context beyond the vulnerable component.
Root Cause
The root cause is improper neutralization of input during web page generation within Contao's template rendering path. Certain templates emit user-influenced data without applying the encoding needed to prevent script injection. This aligns with [CWE-79] and the alternate XSS syntax variant tracked as [CWE-87], where attackers use non-standard encodings to bypass filters.
Attack Vector
An attacker with a privileged Contao account submits crafted content that reaches an affected template. When a victim renders the page containing that content, the browser interprets the injected payload as executable script. Typical outcomes include cookie theft, forced actions through the victim's session, and unauthorized modifications to CMS data.
No verified public proof-of-concept code is available. Refer to the Contao Security Advisory and GitHub Security Advisory GHSA-68q5-78xp-cwwc for vendor-provided technical details.
Detection Methods for CVE-2025-65961
Indicators of Compromise
- Unexpected <script> tags, event handlers such as onerror or onload, or javascript: URIs stored in Contao content records or template variables.
- Web server or reverse proxy logs showing back-end POST requests from privileged accounts containing HTML or encoded script payloads.
- Anomalous outbound requests from administrator browsers to attacker-controlled hosts shortly after loading Contao pages.
Detection Strategies
- Review database entries for content editable by non-super-admin roles, searching for HTML tags and encoded scripting syntax in fields rendered by the affected templates.
- Compare deployed template files against upstream releases 4.13.57, 5.3.42, or 5.6.5 to confirm patched versions are in place.
- Enable and monitor Content Security Policy (CSP) violation reports to surface inline script execution attempts on Contao front-end and back-end pages.
Monitoring Recommendations
- Alert on new or modified administrator sessions immediately following content edits by lower-privileged Contao users.
- Track failed and successful logins to the Contao back office and correlate with suspicious content changes.
- Ingest Contao web server access logs into a SIEM to identify repeated requests with encoded XSS payloads targeting template-driven URLs.
How to Mitigate CVE-2025-65961
Immediate Actions Required
- Upgrade Contao to 4.13.57, 5.3.42, or 5.6.5 depending on the deployed major version.
- Audit privileged user accounts and revoke access for accounts that no longer require content editing rights.
- Rotate session cookies and back-office credentials if injected content is discovered during triage.
Patch Information
Contao released fixed versions 4.13.57, 5.3.42, and 5.6.5 that correct the template output encoding. Upgrade instructions and details are available in the Contao Security Advisory and in GitHub Security Advisory GHSA-68q5-78xp-cwwc.
Workarounds
- Avoid using the affected templates until the upgrade is applied, replacing them with safe alternatives where feasible.
- Manually patch the vulnerable templates by applying the encoding changes referenced in the vendor advisory.
- Deploy a strict Content Security Policy that blocks inline scripts to reduce the impact of XSS payloads reaching browsers.
# Upgrade Contao via Composer to a patched release
composer require contao/manager-bundle:5.6.5 --update-with-all-dependencies
# Or for the 5.3 branch
composer require contao/manager-bundle:5.3.42 --update-with-all-dependencies
# Or for the 4.13 branch
composer require contao/manager-bundle:4.13.57 --update-with-all-dependencies
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

