Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit form with HTML payload
-
ExploitSanitizer ignores empty allowedTags configuration
-
ExecutionPermissive default tags pass through
-
ImpactXSS payload executes in user browser
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires express-xss-sanitizer library version <= 2.0.1 used in a Node.js application where developer explicitly configured allowedTags: [] and allowedAttributes: {} expecting strict sanitization. Remote unauthenticated attacker can inject malicious HTML/JavaScript through user input fields processed by the vulnerable sanitizer. |
| Impact | Real-world exploitation risk is moderate despite the 8.2 CVSS score. The CVSS vector (AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N) indicates unauthenticated network attackers can exploit this with low complexity, achieving high integrity impact and low confidentiality impact. However, actual XSS exploitation depends on downstream context: whether sanitized output is rendered in HTML contexts without further encoding, the application's Content Security Policy, and whether attackers can control user input reaching the vulnerable sanitization function. Public exploit code exists in the form of a documented proof-of-concept showing configuration bypass. No CISA KEV listing indicates this is not confirmed as actively exploited in the wild. The primary risk materializes in applications where developers explicitly configured empty allowlists believing all HTML would be stripped, then rendered the output in web pages. Organizations using default configurations or non-empty allowlists remain unaffected by this specific bypass. The availability of a vendor patch (version 2.0.2) and the specificity of the vulnerable configuration pattern suggest this is a high-priority issue for affected deployments but not a broad internet-scale threat requiring emergency response. |
| Exploit ScenarioDerived | An attacker submits malicious input containing HTML anchor tags with JavaScript URLs or external phishing links to an Express application using express-xss-sanitizer version 2.0.1 configured with empty allowedTags arrays. The developer expects all HTML to be stripped, but the vulnerability causes the library to fall back to permissive defaults, preserving the malicious anchor tag with href attribute. When the application renders this supposedly sanitized content in user profiles or comment sections without additional encoding, victims clicking the injected links are redirected to attacker-controlled domains for phishing or malware distribution. Public exploit code exists demonstrating this configuration bypass. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Mar 27, 2026
express-xss-sanitizer versions 2.0.1 and earlier silently ignore restrictive sanitization configurations when developers explicitly set empty allowedTags or allowedAttributes arrays, instead defaulting to permissive HTML allowlists that can enable XSS attacks. The CVSS score of 8.2 (AV:N/AC:L/PR:N/UI:N) reflects network-accessible, unauthenticated exploitation with high integrity impact. A public proof-of-concept demonstrating the configuration bypass exists in the GitHub security advisory, showing how input intended to be stripped of all HTML instead preserves anchor tags with href attributes and paragraph elements. No EPSS score or CISA KEV status was provided in the intelligence data.
RemediationAI
Upgrade express-xss-sanitizer to version 2.0.2 or later, which corrects the validation logic to respect explicitly provided empty configurations (see release at https://github.com/AhmedAdelFahim/express-xss-sanitizer/releases/tag/v2.0.2 and patch commit at https://github.com/AhmedAdelFahim/express-xss-sanitizer/commit/5623009ef11dcf095c163a38dea07b9cc22ad19f). The vendor advisory is available at https://github.com/AhmedAdelFahim/express-xss-sanitizer/security/advisories/GHSA-3843-rr4g-m8jq and through GitHub's advisory database at https://github.com/advisories/GHSA-3843-rr4g-m8jq. Organizations unable to upgrade immediately should implement compensating controls by calling sanitize-html directly with explicit empty configuration objects rather than relying on express-xss-sanitizer's wrapper, or implement additional output encoding at render time using context-appropriate escaping functions. Review all code locations where empty allowedTags or allowedAttributes configurations were used and verify sanitization behavior matches security requirements.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in npm
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
This vulnerability affects the express-xss-sanitizer npm package (CPE: pkg:npm/express-xss-sanitizer), a Node.js middleware library that wraps sanitize-html for XSS protection in Express applications. The root cause is CWE-79 (Improper Neutralization of Input During Web Page Generation) manifesting through flawed validation logic. When developers pass empty configuration objects (allowedTags: [] or allowedAttributes: {}) to enforce strict HTML stripping, the library performs length checks that treat empty arrays and objects as unset parameters. This triggers fallback behavior to sanitize-html's default permissive configuration, which allows tags like a, p, div, table, and attributes like href. The discrepancy between developer intent (strip all HTML) and actual behavior (allow default tag set) creates a security boundary violation where content expected to be sanitized remains dangerous.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N
Primary rating from GitHub Advisory · only source for this CVE.
CVSS VectorGitHub Advisory
Lifecycle Timeline
2DescriptionGitHub Advisory
Description
A vulnerability has been identified in express-xss-sanitizer (<= 2.0.1) where restrictive sanitization configurations are silently ignored.
When a developer explicitly sets:
allowedTags: [] allowedAttributes: {}
the library incorrectly treats these values as "not provided" due to length/emptiness checks, and falls back to sanitize-html's default configuration.
As a result, instead of stripping all HTML tags and attributes, the sanitizer allows a permissive set of tags ` (e.g., <a>, <p>, <div>, etc.) and attributes (e.g., href on <a>)`.
This behavior violates the expected API contract and may lead to security issues such as content injection or XSS, depending on how the sanitized output is used.
Impact
Developers intending to fully strip HTML content by providing empty allowedTags or allowedAttributes configurations may unknowingly allow a wide range of HTML elements and attributes.
This can result in:
- Injection of unintended HTML content
`(e.g., <div>, <table>, headings)` - Injection of links via
`<a href="...">` - Potential XSS vectors depending on downstream usage
The impact depends on how the sanitized output is rendered or consumed, but the root issue is a mismatch between developer intent and actual behavior.
Proof of Concept
const { sanitize } = require('express-xss-sanitizer');
const sanitizeHtml = require('sanitize-html');
const input = '<a href="http://evil.com">click</a><p>phish</p>';
// Using express-xss-sanitizer (v2.0.1)
sanitize(input, { allowedTags: [], allowedAttributes: {} });
// => '<a href="http://evil.com">click</a><p>phish</p>'
// Expected behavior (sanitize-html directly)
sanitizeHtml(input, { allowedTags: [], allowedAttributes: {} });
// => 'clickphish'Root Cause
The issue was caused by validation logic that checked for non-empty arrays/objects:
- allowedTags required length > 0
- allowedAttributes required Object.keys(...).length > 0
This caused empty configurations ([]) and ({}) to be ignored, resulting in fallback to default permissive settings.
Fix
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.
Blast Radius
ecosystem impact- 3 npm packages depend on express-xss-sanitizer (3 direct, 0 indirect)
Ecosystem-wide dependent count for version 2.0.2.
Executive ViewAI
express-xss-sanitizer versions 2.0.1 and earlier contain a configuration bypass vulnerability that causes the library to ignore developer-specified restrictions on HTML tags and attributes, potentially allowing malicious scripts to persist in user input. Organizations using this library for input sanitization face elevated risk of cross-site scripting (XSS) attacks that could compromise user sessions, steal credentials, or inject malware, particularly if applications rely on this library as a primary defense layer.
Apply vendor patch. If immediate patching is not feasible: implement Web Application Firewall (WAF) rules to detect and block common XSS payloads targeting anchor href and paragraph elements; enforce Content Security Policy (CSP) headers with strict script-src directives; disable or restrict HTML input acceptance where possible; implement output encoding on all user-supplied data regardless of sanitizer configuration.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
EUVD-2026-16876
GHSA-3843-rr4g-m8jq
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB