Medium

express-xss-sanitizer has an unbounded recursion depth

  • Disclosed: 26.09.2025
  • Updated: 11.10.2026 10:22

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:

bash
npm install express-xss-sanitizer@latest

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package express-xss-sanitizer < 2.0.1 2.0.1

References

CVSS score -
CVSS 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
Weakness (CWE)
CWE-674
Platform
npm
Package
express-xss-sanitizer
Disclosed
26.09.2025
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-hvq2-wf92-j4f3 - CC BY 4.0

Vulnerability history: express-xss-sanitizer

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
3
First → latest
09.2022 03.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 1
  • Medium 2

Disclosures per year

  1. 2022: 1
  2. 2023: 0
  3. 2024: 0
  4. 2025: 1
  5. 2026: 1
  1. express-xss-sanitizer has an unbounded recursion depth this entry
    Medium CVE-2025-59364 < 2.0.1 2.0.1

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.