Skip to main content

EUVDEUVD-2026-16876

| CVE-2026-33979 HIGH
Cross-site Scripting (XSS) (CWE-79)
2026-03-27 https://github.com/AhmedAdelFahim/express-xss-sanitizer GHSA-3843-rr4g-m8jq
8.2
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit form with HTML payload
  2. Exploit
    Sanitizer ignores empty allowedTags configuration
  3. Execution
    Permissive default tags pass through
  4. Impact
    XSS 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

npm express-xss-sanitizer fix: 2.0.2

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

GitHub Advisory PRIMARY 8.2 HIGH
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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
None

Lifecycle Timeline

2
Patch released
Mar 27, 2026 - 18:00 nvd
Patch available
CVE Published
Mar 27, 2026 - 17:56 nvd
HIGH 8.2

DescriptionGitHub 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

javascript
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
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 3 npm packages depend on express-xss-sanitizer (3 direct, 0 indirect)

Ecosystem-wide dependent count for version 2.0.2.

Executive ViewAI

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.0%
Top 99% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

41
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +41
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Affected Products (CPE)GitHub Advisory

pkg:npm/express-xss-sanitizer

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy