Skip to main content
Vulnerability Database/CVE-2025-29790

CVE-2025-29790: Contao CMS SVG Upload RCE Vulnerability

CVE-2025-29790 is a remote code execution vulnerability in Contao CMS allowing attackers to upload malicious SVG files that execute unauthorized code in both back end and front end. This article covers technical details, affected versions, security impact, and available patches.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-29790 Overview

CVE-2025-29790 is a stored cross-site scripting (XSS) vulnerability in Contao, an open-source content management system (CMS). Authenticated users can upload Scalable Vector Graphics (SVG) files containing malicious JavaScript. The embedded code executes in the context of users who view the uploaded files in the back end or front end of the Contao installation. The weakness is tracked under CWE-79 and was published to the National Vulnerability Database (NVD) on March 18, 2025. Contao has released fixed releases in versions 4.13.54, 5.3.30, and 5.5.6.

Critical Impact

An authenticated attacker with upload permissions can inject persistent JavaScript into the Contao CMS, enabling session theft, account takeover, and front-end user compromise.

Affected Products

  • Contao CMS versions prior to 4.13.54
  • Contao CMS 5.3.x versions prior to 5.3.30
  • Contao CMS 5.5.x versions prior to 5.5.6

Discovery Timeline

  • 2025-03-18 - CVE-2025-29790 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-29790

Vulnerability Analysis

Contao accepts SVG files through its file upload functionality without stripping active content from the XML document. SVG is an XML-based image format that permits inline <script> elements, event handlers such as onload, and <foreignObject> embedding of HTML. When an uploaded SVG is rendered inline or served directly from the Contao domain, the browser parses the embedded JavaScript and executes it under the origin of the Contao site.

This is a stored XSS condition. The payload persists on the server and executes every time a back-end administrator or front-end visitor loads the file. An attacker who gains editor-level access, or who tricks a privileged user into uploading a crafted file, can hijack back-end sessions and pivot to full administrative control of the CMS.

Root Cause

The root cause is insufficient sanitization of user-supplied SVG content on upload and insecure delivery of the files to browsers. Contao did not remove scriptable elements, event-handler attributes, or external references from SVG documents before storing them. The fixed releases sanitize SVG files to neutralize executable content.

Attack Vector

Exploitation requires network access to the Contao back end and an account with file upload privileges. The attacker uploads an SVG document containing a JavaScript payload inside a <script> tag or an event-handler attribute. Victim interaction, such as previewing the file in the asset manager or visiting a front-end page that embeds the image, triggers execution. No further authentication of the victim is required beyond normal browsing of the site.

See the Contao security advisory for payload specifics:
https://contao.org/en/security-advisories/cross-site-scripting-through-svg-uploads

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2025-29790

Indicators of Compromise

  • SVG files in Contao files/ directories that contain <script>, onload=, onclick=, or <foreignObject> elements.
  • Unexpected outbound requests from administrator browsers to attacker-controlled domains after viewing the Contao back end.
  • New or modified back-end user accounts, altered permissions, or unexplained content changes following SVG uploads.
  • Access log entries showing direct GET requests to .svg files from unauthenticated front-end visitors immediately before suspicious activity.

Detection Strategies

  • Scan the Contao file repository for SVG files containing scriptable XML elements or JavaScript URIs.
  • Review web server logs for POST requests to Contao upload endpoints that reference SVG MIME types from non-administrative accounts.
  • Correlate back-end login sessions with subsequent privilege changes to identify session hijacking patterns consistent with stored XSS exploitation.

Monitoring Recommendations

  • Enable Content Security Policy (CSP) reporting and alert on script-src violations originating from /files/ URLs.
  • Monitor Contao audit logs for file upload events by low-privileged users followed by back-end access from unexpected IP addresses.
  • Integrate web server and CMS logs into a centralized analytics platform to detect anomalous access patterns against uploaded SVG assets.

How to Mitigate CVE-2025-29790

Immediate Actions Required

  • Upgrade Contao to version 4.13.54, 5.3.30, or 5.5.6 depending on the installed branch.
  • Audit existing SVG files in the files/ directory and quarantine any containing script content or event-handler attributes.
  • Rotate back-end user credentials and invalidate active sessions if exploitation is suspected.
  • Restrict file upload permissions to trusted editorial accounts and review recent administrative activity.

Patch Information

Contao published fixed releases on the official project channels. Review the Contao Security Advisory on XSS and the GitHub Security Advisory GHSA-vqqr-fgmh-f626 for upgrade instructions. Apply the patch using Composer and clear the Contao cache after deployment.

Workarounds

  • Disable SVG as an allowed upload type in Contao back-end settings until the patch is applied.
  • Configure the web server to serve .svg responses with Content-Disposition: attachment so browsers download rather than render the files.
  • Deploy a strict Content Security Policy that forbids inline scripts and restricts script sources to trusted origins.
bash
# nginx example: force SVG files to download instead of render
location ~* \.svg$ {
    add_header Content-Disposition "attachment";
    add_header X-Content-Type-Options "nosniff";
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.