5.3medium
express-xss-sanitizer has an unbounded recursion depth
- Severity
- 5.3medium CVSS:3.1 by mitre
- Exploit likelihood
- 0.47% (higher than 42% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-hvq2-wf92-j4f3
Description
The express-xss-sanitizer (aka Express XSS Sanitizer) package through 2.0.0 for Node.js has an unbounded recursion depth in sanitize in lib/sanitize.js for a JSON request body.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Express XSS Sanitizer project Express XSS Sanitizer | 2.0.0 | CVE List |
| express-xss-sanitizer (npm) | before 2.0.1 | GitHub Advisory Database |
All scores
| mitre | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
The express-xss-sanitizer (aka Express XSS Sanitizer) package through 2.0.0 for Node.js has an unbounded recursion depth in sanitize in lib/sanitize.js for a JSON request body.
GitHub Advisory Database
Security Advisory: express-xss-sanitizer
Overview
A vulnerability was discovered in express-xss-sanitizer that allowed unbounded recursion depth during sanitization of nested objects.
Affected Versions
- All versions prior to 2.0.1
Patched Versions
- 2.0.1 and later
Description
The sanitize function in lib/sanitize.js performed recursive sanitization without depth limiting, making it vulnerable to stack overflow attacks via specially crafted deeply nested JSON objects.
Impact
An attacker could cause denial-of-service by sending a request with deeply nested structures, potentially crashing the Node.js process.
Solution
Upgrade to version 2.0.1 or later:
npm install express-xss-sanitizer@latest
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-59364 changed 2025-09-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-hvq2-wf92-j4f3 changed 2025-09-26 | CC-BY-4.0 |
| NVD | CVE-2025-59364 changed 2026-06-17 | Public domain |