CVE-2025-59364
JSON

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 packageVersionsReported by
Express XSS Sanitizer project Express XSS Sanitizer2.0.0CVE List
express-xss-sanitizer (npm)before 2.0.1GitHub Advisory Database

All scores

mitre5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
GitHubmedium CVSS:4.0CVSS: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

CWE-674

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

SourceRecordLicence
CVE ListCVE-2025-59364 changed 2025-09-15CVE Terms of Use
GitHub Advisory DatabaseGHSA-hvq2-wf92-j4f3 changed 2025-09-26CC-BY-4.0
NVDCVE-2025-59364 changed 2026-06-17Public domain