CVE-2024-45296

7.5 HIGH

📋 TL;DR

CVE-2024-45296 is a denial-of-service vulnerability in the path-to-regexp library where certain path patterns generate inefficient regular expressions. When exploited, these regex patterns cause excessive CPU consumption that blocks the JavaScript event loop, leading to application unresponsiveness. This affects any application using vulnerable versions of path-to-regexp for URL routing or path matching.

💻 Affected Systems

Products:
  • path-to-regexp library
  • Applications using path-to-regexp for routing
Versions: All versions before 0.1.10 for 0.1.x branch, all versions before 8.0.0 for other branches
Operating Systems: All platforms running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability triggers when using path patterns with two parameters in a single segment separated by non-period characters (e.g., '/:foo-:bar').

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete application denial-of-service where the Node.js process becomes unresponsive, requiring restart and causing extended downtime.

🟠

Likely Case

Application performance degradation and intermittent unresponsiveness when malicious requests trigger the vulnerable path patterns.

🟢

If Mitigated

Minimal impact with proper rate limiting, request validation, and updated library versions.

🌐 Internet-Facing: HIGH - Public endpoints using path-to-regexp for routing are directly exposed to DoS attacks.
🏢 Internal Only: MEDIUM - Internal applications are still vulnerable but have reduced attack surface compared to internet-facing systems.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending requests to endpoints using vulnerable path patterns. The advisory includes specific pattern examples that trigger the issue.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.1.10 for 0.1.x branch, 8.0.0 for all other branches

Vendor Advisory: https://github.com/pillarjs/path-to-regexp/security/advisories/GHSA-9wv6-86v2-598j

Restart Required: Yes

Instructions:

1. Check current path-to-regexp version in package.json. 2. Update to 0.1.10 if using 0.1.x. 3. Update to 8.0.0 if using any other version. 4. Run npm update or yarn upgrade. 5. Restart the application.

🔧 Temporary Workarounds

Input validation for path patterns

all

Reject or sanitize path patterns containing two parameters in a single segment separated by non-period characters

Rate limiting

all

Implement request rate limiting to prevent DoS attacks

🧯 If You Can't Patch

  • Implement WAF rules to block requests matching vulnerable path patterns
  • Use reverse proxy with regex timeout limits and request filtering

🔍 How to Verify

Check if Vulnerable:

Check package.json or package-lock.json for path-to-regexp version. Versions <0.1.10 (for 0.1.x) or <8.0.0 (for other branches) are vulnerable.

Check Version:

npm list path-to-regexp or check package.json

Verify Fix Applied:

Verify path-to-regexp version is 0.1.10+ (0.1.x) or 8.0.0+ (other branches) after update. Test with known vulnerable path patterns.

📡 Detection & Monitoring

Log Indicators:

  • High CPU usage spikes
  • Increased request processing times
  • Application timeout errors
  • Requests with patterns like '/:param1-:param2'

Network Indicators:

  • Repeated requests to same endpoint with varying parameters
  • Unusually high request volume to specific routes

SIEM Query:

source="application.logs" AND (message="high cpu" OR message="timeout" OR message="event loop blocked") AND process="node"

🔗 References

📤 Share & Export