Skip to main content

CVE-2022-24899: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in contao contao

Medium
Published: Thu May 05 2022 (05/05/2022, 23:45:13 UTC)
Source: CVE
Vendor/Project: contao
Product: contao

Description

Contao is a powerful open source CMS that allows you to create professional websites and scalable web applications. In versions of Contao prior to 4.13.3 it is possible to inject code into the canonical tag. As a workaround users may disable canonical tags in the root page settings.

AI-Powered Analysis

AILast updated: 06/23/2025, 09:50:02 UTC

Technical Analysis

CVE-2022-24899 is a cross-site scripting (XSS) vulnerability identified in Contao, an open-source content management system (CMS) widely used for creating professional websites and scalable web applications. The vulnerability affects Contao versions prior to 4.13.3. Specifically, the issue arises from improper neutralization of input during web page generation, classified under CWE-79. The vulnerability allows an attacker to inject malicious code into the canonical tag of a web page. The canonical tag is an HTML element used to indicate the preferred URL of a web page to search engines, and it is typically included in the <head> section of the HTML document. By injecting malicious scripts into this tag, an attacker can execute arbitrary JavaScript in the context of the victim's browser when they visit the affected page. This can lead to session hijacking, defacement, or redirection to malicious sites. The vulnerability does not require authentication, meaning any unauthenticated attacker can exploit it by crafting a malicious URL or input that gets reflected in the canonical tag. The issue can be mitigated temporarily by disabling canonical tags in the root page settings, although this is a workaround rather than a full fix. The vulnerability was addressed in Contao version 4.13.3, where proper input sanitization and neutralization were implemented to prevent code injection. There are no known exploits in the wild reported to date, and no official CVSS score has been assigned. The vulnerability is considered medium severity due to the potential for client-side code execution but limited to the scope of the canonical tag injection vector.

Potential Impact

For European organizations using Contao CMS versions prior to 4.13.3, this vulnerability poses a risk of client-side script injection leading to cross-site scripting attacks. The impact includes potential theft of user credentials, session tokens, or other sensitive information accessible via the browser. It could also facilitate phishing attacks by altering page content or redirecting users to malicious sites. Organizations that rely on Contao for public-facing websites, especially those handling sensitive user data or providing critical services, could suffer reputational damage and loss of user trust if exploited. The vulnerability could also be leveraged as a stepping stone for further attacks, such as delivering malware or conducting broader social engineering campaigns. However, the impact is somewhat limited by the fact that exploitation requires the attacker to inject malicious input into the canonical tag, which may depend on specific site configurations or user input vectors. The absence of known active exploitation reduces immediate risk but does not eliminate the threat. European organizations in sectors such as government, finance, healthcare, and e-commerce that use Contao CMS should be particularly vigilant, as these sectors are frequent targets of web-based attacks and data breaches.

Mitigation Recommendations

1. Upgrade Contao CMS to version 4.13.3 or later immediately to apply the official patch that neutralizes input in the canonical tag. 2. Until the upgrade is possible, disable canonical tags in the root page settings as a temporary workaround to prevent injection via this vector. 3. Implement a web application firewall (WAF) with rules to detect and block suspicious input patterns targeting the canonical tag or other HTML elements. 4. Conduct a thorough audit of all user input fields and URL parameters that could influence page metadata to ensure proper input validation and output encoding. 5. Educate web developers and administrators on secure coding practices, particularly regarding input sanitization and output encoding in CMS templates and plugins. 6. Monitor web server logs and application logs for unusual or suspicious requests that may indicate attempted exploitation. 7. Employ Content Security Policy (CSP) headers to restrict the execution of unauthorized scripts on web pages, mitigating the impact of potential XSS attacks. 8. Regularly review and update all third-party plugins or extensions used with Contao to ensure they do not introduce similar vulnerabilities.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-02-10T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9843c4522896dcbf2da2

Added to database: 5/21/2025, 9:09:23 AM

Last enriched: 6/23/2025, 9:50:02 AM

Last updated: 8/1/2025, 2:34:46 AM

Views: 12

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats