{"id":"CVE-2025-59364","aliases":["EUVD-2025-29138","GHSA-hvq2-wf92-j4f3","GHSA-qhwp-454g-2gv4"],"status":"published","title":"express-xss-sanitizer has an unbounded recursion depth","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.","severity":{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00449,"percentile":0.39507,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-674"],"published":"2025-09-14T00:00:00Z","modified":"2026-10-28T02:30:28Z","fixes":[{"ecosystem":"npm","package":"express-xss-sanitizer","fixed_in":["2.0.1"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"express-xss-sanitizer","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.0.1"}]}]},{"source":"osv","ecosystem":"npm","package":"express-xss-sanitizer","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.0.1"}]}]}],"products":[{"vendor":"express xss sanitizer project","product":"express xss sanitizer"}],"references":[{"url":"https://github.com/AhmedAdelFahim/express-xss-sanitizer","tags":["package"]},{"url":"https://www.npmjs.com/package/express-xss-sanitizer","tags":["web"]},{"url":"https://gist.github.com/Spendroslav/177804eaef5acfb222a550de212a1b94","tags":["web"]},{"url":"https://github.com/AhmedAdelFahim/express-xss-sanitizer/security/advisories/GHSA-hvq2-wf92-j4f3","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-59364","tags":["advisory"]},{"url":"https://github.com/AhmedAdelFahim/express-xss-sanitizer/pull/23","tags":["web"]},{"url":"https://github.com/AhmedAdelFahim/express-xss-sanitizer/commit/62d6542a2a57298da7a2e02de623454007e4f6d6","tags":["web"]},{"url":"https://dbugs.ptsecurity.com/vulnerability/PT-2025-37434","tags":["web"]},{"url":"https://www.tenable.com/cve/CVE-2025-59364","tags":["web"]},{"url":"https://github.com/advisories/GHSA-hvq2-wf92-j4f3"},{"url":"https://github.com/advisories/GHSA-qhwp-454g-2gv4"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/59xxx/CVE-2025-59364.json","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2025-59364","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.","status":"published","published":"2025-09-14T00:00:00Z","modified":"2025-09-15T15:57:53.693Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"medium","assessor":"cna"}],"cwes":["CWE-674"],"updated_at":"2026-11-02T14:32:48.167635Z"}],"euvd":[{"id":"EUVD-2025-29138","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.","status":"published","published":"2025-09-14T00:00:00Z","modified":"2025-09-15T15:57:53Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"medium"}],"updated_at":"2026-11-02T20:31:44.034664Z"}],"ghsa":[{"id":"GHSA-hvq2-wf92-j4f3","title":"express-xss-sanitizer has an unbounded recursion depth","description":"# Security Advisory: express-xss-sanitizer\n\n## Overview\nA vulnerability was discovered in express-xss-sanitizer that allowed unbounded recursion depth during sanitization of nested objects.\n\n## Affected Versions\n- All versions prior to 2.0.1\n\n## Patched Versions\n- 2.0.1 and later\n\n## Description\nThe 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.\n\n## Impact\nAn attacker could cause denial-of-service by sending a request with deeply nested structures, potentially crashing the Node.js process.\n\n## Solution\nUpgrade to version 2.0.1 or later:\n\n```bash\nnpm install express-xss-sanitizer@latest\n```","status":"published","published":"2025-09-26T14:38:13Z","modified":"2025-09-26T14:38:14Z","cvss":[{"version":"4.0","score":6.9,"vector":"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","level":"medium"}],"cwes":["CWE-674"],"updated_at":"2026-11-02T14:38:58.965005Z"},{"id":"GHSA-qhwp-454g-2gv4","title":"Duplicate Advisory: express-xss-sanitizer has an unbounded recursion depth","description":"## Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-hvq2-wf92-j4f3. This link is maintained to preserve external references.\n\n## Original Descripton\n\nThe `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.","status":"withdrawn","published":"2025-09-15T00:30:15Z","modified":"2025-09-26T14:38:06Z","cvss":[{"version":"4.0","score":6.9,"vector":"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","level":"medium"}],"cwes":["CWE-674"],"updated_at":"2026-11-02T14:38:58.965005Z"}],"nvd":[{"id":"CVE-2025-59364","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.","status":"published","published":"2025-09-14T23:15:37.32Z","modified":"2026-06-17T09:46:01.287Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"medium","assessor":"secondary"}],"cwes":["CWE-674"],"updated_at":"2026-11-02T14:11:29.650057Z"}],"osv":[{"id":"CVE-2025-59364","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.","status":"published","published":"2025-09-14T00:00:00Z","modified":"2026-10-28T02:30:28.762452269Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"medium"}],"cwes":["CWE-674"],"updated_at":"2026-11-02T15:44:51.190588Z"},{"id":"GHSA-hvq2-wf92-j4f3","title":"express-xss-sanitizer has an unbounded recursion depth","description":"# Security Advisory: express-xss-sanitizer\n\n## Overview\nA vulnerability was discovered in express-xss-sanitizer that allowed unbounded recursion depth during sanitization of nested objects.\n\n## Affected Versions\n- All versions prior to 2.0.1\n\n## Patched Versions\n- 2.0.1 and later\n\n## Description\nThe 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.\n\n## Impact\nAn attacker could cause denial-of-service by sending a request with deeply nested structures, potentially crashing the Node.js process.\n\n## Solution\nUpgrade to version 2.0.1 or later:\n\n```bash\nnpm install express-xss-sanitizer@latest\n```","status":"published","published":"2025-09-26T14:38:13Z","modified":"2025-09-26T14:57:09.094984Z","cvss":[{"version":"4.0","score":6.9,"vector":"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","level":"medium"}],"cwes":["CWE-674"],"updated_at":"2026-11-02T15:46:49.621585Z"},{"id":"GHSA-qhwp-454g-2gv4","title":"Duplicate Advisory: express-xss-sanitizer has an unbounded recursion depth","description":"## Duplicate Advisory\nThis advisory has been withdrawn because it is a duplicate of GHSA-hvq2-wf92-j4f3. This link is maintained to preserve external references.\n\n## Original Descripton\n\nThe `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.","status":"withdrawn","published":"2025-09-15T00:30:15Z","modified":"2025-09-26T14:38:04Z","cvss":[{"version":"4.0","score":6.9,"vector":"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","level":"medium"}],"cwes":["CWE-674"],"updated_at":"2026-11-02T15:46:54.760124Z"}]}}
