# CVE-2026-33979: Express XSS Sanitizer: allowedTags/allowedAttributes bypass leads to permissive sanitization (XSS risk)

> Attackers can bypass XSS sanitization in Express applications by exploiting ignored restrictive configurations, potentially executing malicious scripts.

- **Severity:** High 8.2 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Mar 2026
- **Updated:** 31 Mar 2026
- **Also known as:** GHSA-3843-rr4g-m8jq

## What is CVE-2026-33979?

CVE-2026-33979 is a high-severity cross-site scripting vulnerability in AhmedAdelFahim express-xss-sanitizer, published on 27 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation), CWE-183 (Permissive List of Allowed Inputs)

## Which versions are affected by CVE-2026-33979?

2 open source packages ship an affected version, including express-xss-sanitizer. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `express-xss-sanitizer` | npm | All versions | 2.0.2 |
| `express-xss-sanitizer` | npm | All versions | 2.0.2 |

Products: Express Xss Sanitizer Project Express Xss Sanitizer.

## How do I fix CVE-2026-33979?

Upgrade express-xss-sanitizer to 2.0.2 or later.

## Is CVE-2026-33979 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-33979 exists.

## Other vulnerabilities in AhmedAdelFahim express-xss-sanitizer

- [CVE-2022-21169](https://insights.sbomify.com/CVE-2022-21169/): Prototype Pollution (high 7.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-33979 and fix it if it is affected.

What it is: CVE-2026-33979 is a high-severity cross-site scripting vulnerability in AhmedAdelFahim express-xss-sanitizer, published on 27 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-33979 exists.

Affected packages and fixed versions:
- express-xss-sanitizer (npm): affected all versions; fixed in 2.0.2
- express-xss-sanitizer (npm): affected all versions; fixed in 2.0.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-33979/ (Markdown: https://insights.sbomify.com/CVE-2026-33979/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-33979
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-33979
- OSV: https://osv.dev/vulnerability/CVE-2026-33979

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-33979/
Summaries are generated and may contain mistakes; the official description above is the record.
