CVE-2025-59364: express-xss-sanitizer has an unbounded recursion depth
(updated )
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.
References
- dbugs.ptsecurity.com/vulnerability/PT-2025-37434
- gist.github.com/Spendroslav/177804eaef5acfb222a550de212a1b94
- github.com/AhmedAdelFahim/express-xss-sanitizer
- github.com/AhmedAdelFahim/express-xss-sanitizer/commit/62d6542a2a57298da7a2e02de623454007e4f6d6
- github.com/AhmedAdelFahim/express-xss-sanitizer/pull/23
- github.com/AhmedAdelFahim/express-xss-sanitizer/security/advisories/GHSA-hvq2-wf92-j4f3
- github.com/advisories/GHSA-hvq2-wf92-j4f3
- nvd.nist.gov/vuln/detail/CVE-2025-59364
- www.npmjs.com/package/express-xss-sanitizer
- www.tenable.com/cve/CVE-2025-59364
Code Behaviors & Features
Detect and mitigate CVE-2025-59364 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →