express-xss-sanitizer has an unbounded recursion depth
Moderate severity
GitHub Reviewed
Published
Sep 26, 2025
in
AhmedAdelFahim/express-xss-sanitizer
•
Updated Sep 26, 2025
Description
Published to the GitHub Advisory Database
Sep 26, 2025
Reviewed
Sep 26, 2025
Last updated
Sep 26, 2025
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
Patched Versions
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:
References