CVE-2025-59364
express-xss-sanitizer has an unbounded recursion depth
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used 5.3
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.
- Record
CVE-2025-59364- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Weakness
- CWE-674
- Updated
- 2026-11-02
EUVDEUVD-2025-29138 5.3
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.
- Record
EUVD-2025-29138- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-hvq2-wf92-j4f3 6.9
express-xss-sanitizer has an unbounded recursion depth
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
- Record
GHSA-hvq2-wf92-j4f3- CVSS 4.0
- 6.9 Medium
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 - Weakness
- CWE-674
- Updated
- 2026-11-02
GitHub AdvisoriesGHSA-qhwp-454g-2gv4 6.9
Duplicate Advisory: express-xss-sanitizer has an unbounded recursion depth
Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-hvq2-wf92-j4f3. This link is maintained to preserve external references.
Original Descripton
The express-xss-sanitizer package for Node.js has an unbounded recursion in the sanitize function (lib/sanitize.js) when processing JSON request bodies. A remote attacker can send a deeply nested payload to any endpoint that applies this sanitizer, driving excessive recursion and resource consumption (CPU) until the process becomes unresponsive or crashes (e.g., “Maximum call stack size exceeded”). This causes a denial of service. The issue is present through version 2.0.0; no fixed release is available as of this update.
- Record
GHSA-qhwp-454g-2gv4- CVSS 4.0
- 6.9 Medium
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 - Weakness
- CWE-674
- Updated
- 2026-11-02
NVD 5.3
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.
- Record
CVE-2025-59364- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Weakness
- CWE-674
- Updated
- 2026-11-02
OSV 5.3
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.
- Record
CVE-2025-59364- CVSS 3.1
- 5.3 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L - Weakness
- CWE-674
- Updated
- 2026-11-02
OSVGHSA-hvq2-wf92-j4f3 6.9
express-xss-sanitizer has an unbounded recursion depth
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
- Record
GHSA-hvq2-wf92-j4f3- CVSS 4.0
- 6.9 Medium
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 - Weakness
- CWE-674
- Updated
- 2026-11-02
OSVGHSA-qhwp-454g-2gv4 6.9
Duplicate Advisory: express-xss-sanitizer has an unbounded recursion depth
Duplicate Advisory
This advisory has been withdrawn because it is a duplicate of GHSA-hvq2-wf92-j4f3. This link is maintained to preserve external references.
Original Descripton
The express-xss-sanitizer package for Node.js has an unbounded recursion in the sanitize function (lib/sanitize.js) when processing JSON request bodies. A remote attacker can send a deeply nested payload to any endpoint that applies this sanitizer, driving excessive recursion and resource consumption (CPU) until the process becomes unresponsive or crashes (e.g., “Maximum call stack size exceeded”). This causes a denial of service. The issue is present through version 2.0.0; no fixed release is available as of this update.
- Record
GHSA-qhwp-454g-2gv4- CVSS 4.0
- 6.9 Medium
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 - Weakness
- CWE-674
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
express-xss-sanitizernpm | before 2.0.1 | 2.0.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-59364 is a medium vulnerability (CVSS 5.3) in Express Xss Sanitizer Project Xss Sanitizer, published September 14, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.45%, the 39th percentile. Fixed in express-xss-sanitizer 2.0.1.
References
github.com/AhmedAdelFahim/express-xss-sanitizer
npmjs.com/package/express-xss-sanitizer
gist.github.com/Spendroslav/177804eaef5acfb222a550de212a1b94
github.com/AhmedAdelFahim/express-xss-sanitizer/security/advisories/GHSA-hvq2-wf92-j4f3
nvd.nist.gov/vuln/detail/CVE-2025-59364
github.com/AhmedAdelFahim/express-xss-sanitizer/pull/23
Show 6 moreShow less
github.com/AhmedAdelFahim/express-xss-sanitizer/commit/62d6542a2a57298da7a2e02de623454007e4f6d6
dbugs.ptsecurity.com/vulnerability/PT-2025-37434
tenable.com/cve/CVE-2025-59364
github.com/advisories/GHSA-hvq2-wf92-j4f3
github.com/advisories/GHSA-qhwp-454g-2gv4
github.com/CVEProject/cvelistV5/tree/main/cves/2025/59xxx/CVE-2025-59364.json