CVE-2026-33979: CWE-183: Permissive List of Allowed Inputs in AhmedAdelFahim express-xss-sanitizer
Express XSS Sanitizer is Express 4.x and 5.x middleware which sanitizes user input data (in req.body, req.query, req.headers and req.params) to prevent Cross Site Scripting (XSS) attack. A vulnerability has been identified in versions prior to 2.0.2 where restrictive sanitization configurations are silently ignored. In version 2.0.2, the validation logic has been updated to respect explicitly provided empty configurations. Now, if allowedTags or allowedAttributes are provided (even if empty), they are passed directly to sanitize-html without being overridden.
AI Analysis
Technical Summary
The vulnerability identified as CVE-2026-33979 affects the express-xss-sanitizer middleware used in Express.js applications to sanitize user inputs across req.body, req.query, req.headers, and req.params to prevent Cross-Site Scripting (XSS) attacks. Versions prior to 2.0.2 contain a flaw where restrictive sanitization configurations, specifically those that define allowedTags or allowedAttributes, are silently ignored. This means that even if a developer configures the sanitizer to allow only a limited set of HTML tags or attributes, the middleware fails to enforce these restrictions, resulting in a permissive sanitization policy. Consequently, malicious input containing script tags or event handlers can bypass the sanitizer and be executed in the context of the victim's browser. The root cause lies in the middleware's validation logic, which did not properly respect empty or explicitly set configurations and instead defaulted to a more permissive behavior. In version 2.0.2, this logic was corrected so that any provided configuration, including empty arrays for allowedTags or allowedAttributes, is passed directly to the sanitize-html library, ensuring the intended restrictive sanitization is enforced. The vulnerability is classified under CWE-183 (Permissive List of Allowed Inputs) and CWE-79 (Improper Neutralization of Input During Web Page Generation, i.e., XSS). The CVSS v3.1 score is 8.2 (high), reflecting the vulnerability's network attack vector, low attack complexity, no privileges required, no user interaction, and significant impact on integrity and partial impact on confidentiality. Although no known exploits have been reported in the wild, the vulnerability presents a critical risk to web applications relying on this middleware for input sanitization.
Potential Impact
The primary impact of this vulnerability is the potential for Cross-Site Scripting (XSS) attacks, which can lead to unauthorized script execution in users' browsers. This compromises the confidentiality and integrity of user data, enabling attackers to steal session tokens, perform actions on behalf of users, or deface web content. Since the vulnerability can be exploited remotely without authentication or user interaction, it poses a significant risk to any web application using affected versions of express-xss-sanitizer. Organizations may face data breaches, loss of user trust, regulatory penalties, and reputational damage. The scope includes all Express.js applications that incorporate express-xss-sanitizer versions prior to 2.0.2, which may be widespread given the popularity of Express.js in web development. The vulnerability does not directly affect availability but can indirectly cause service disruptions through exploitation or remediation efforts.
Mitigation Recommendations
To mitigate this vulnerability, organizations should immediately upgrade express-xss-sanitizer to version 2.0.2 or later, where the sanitization logic correctly respects restrictive configurations. Developers should audit their sanitization configurations to ensure allowedTags and allowedAttributes are explicitly defined according to the principle of least privilege. It is recommended to implement Content Security Policy (CSP) headers as an additional defense-in-depth measure against XSS. Regular dependency scanning and software composition analysis should be employed to detect vulnerable versions of express-xss-sanitizer in codebases. Additionally, security testing including automated and manual penetration testing should be conducted to verify that input sanitization is effective. Monitoring web application logs for unusual script injection attempts can help detect exploitation attempts early. Finally, educating developers on secure coding practices related to input validation and sanitization is crucial to prevent similar issues.
Affected Countries
United States, Germany, United Kingdom, India, Canada, Australia, France, Netherlands, Japan, South Korea
CVE-2026-33979: CWE-183: Permissive List of Allowed Inputs in AhmedAdelFahim express-xss-sanitizer
Description
Express XSS Sanitizer is Express 4.x and 5.x middleware which sanitizes user input data (in req.body, req.query, req.headers and req.params) to prevent Cross Site Scripting (XSS) attack. A vulnerability has been identified in versions prior to 2.0.2 where restrictive sanitization configurations are silently ignored. In version 2.0.2, the validation logic has been updated to respect explicitly provided empty configurations. Now, if allowedTags or allowedAttributes are provided (even if empty), they are passed directly to sanitize-html without being overridden.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability identified as CVE-2026-33979 affects the express-xss-sanitizer middleware used in Express.js applications to sanitize user inputs across req.body, req.query, req.headers, and req.params to prevent Cross-Site Scripting (XSS) attacks. Versions prior to 2.0.2 contain a flaw where restrictive sanitization configurations, specifically those that define allowedTags or allowedAttributes, are silently ignored. This means that even if a developer configures the sanitizer to allow only a limited set of HTML tags or attributes, the middleware fails to enforce these restrictions, resulting in a permissive sanitization policy. Consequently, malicious input containing script tags or event handlers can bypass the sanitizer and be executed in the context of the victim's browser. The root cause lies in the middleware's validation logic, which did not properly respect empty or explicitly set configurations and instead defaulted to a more permissive behavior. In version 2.0.2, this logic was corrected so that any provided configuration, including empty arrays for allowedTags or allowedAttributes, is passed directly to the sanitize-html library, ensuring the intended restrictive sanitization is enforced. The vulnerability is classified under CWE-183 (Permissive List of Allowed Inputs) and CWE-79 (Improper Neutralization of Input During Web Page Generation, i.e., XSS). The CVSS v3.1 score is 8.2 (high), reflecting the vulnerability's network attack vector, low attack complexity, no privileges required, no user interaction, and significant impact on integrity and partial impact on confidentiality. Although no known exploits have been reported in the wild, the vulnerability presents a critical risk to web applications relying on this middleware for input sanitization.
Potential Impact
The primary impact of this vulnerability is the potential for Cross-Site Scripting (XSS) attacks, which can lead to unauthorized script execution in users' browsers. This compromises the confidentiality and integrity of user data, enabling attackers to steal session tokens, perform actions on behalf of users, or deface web content. Since the vulnerability can be exploited remotely without authentication or user interaction, it poses a significant risk to any web application using affected versions of express-xss-sanitizer. Organizations may face data breaches, loss of user trust, regulatory penalties, and reputational damage. The scope includes all Express.js applications that incorporate express-xss-sanitizer versions prior to 2.0.2, which may be widespread given the popularity of Express.js in web development. The vulnerability does not directly affect availability but can indirectly cause service disruptions through exploitation or remediation efforts.
Mitigation Recommendations
To mitigate this vulnerability, organizations should immediately upgrade express-xss-sanitizer to version 2.0.2 or later, where the sanitization logic correctly respects restrictive configurations. Developers should audit their sanitization configurations to ensure allowedTags and allowedAttributes are explicitly defined according to the principle of least privilege. It is recommended to implement Content Security Policy (CSP) headers as an additional defense-in-depth measure against XSS. Regular dependency scanning and software composition analysis should be employed to detect vulnerable versions of express-xss-sanitizer in codebases. Additionally, security testing including automated and manual penetration testing should be conducted to verify that input sanitization is effective. Monitoring web application logs for unusual script injection attempts can help detect exploitation attempts early. Finally, educating developers on secure coding practices related to input validation and sanitization is crucial to prevent similar issues.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-03-24T22:20:06.210Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 69c6fa4f3c064ed76ffa5f18
Added to database: 3/27/2026, 9:44:47 PM
Last enriched: 3/27/2026, 9:51:52 PM
Last updated: 3/27/2026, 11:01:53 PM
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.