CVE-2025-25283

7.5 HIGH

📋 TL;DR

The parse-duration library versions before 2.1.3 are vulnerable to denial of service attacks through CPU-bound operations and memory exhaustion. Attackers can cause event loop delays up to 50ms per operation or crash Node.js applications by providing specially crafted large strings. This affects any application using vulnerable versions of parse-duration for duration parsing.

💻 Affected Systems

Products:
  • parse-duration
Versions: All versions prior to 2.1.3
Operating Systems: All platforms running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using parse-duration to process user-provided duration strings is vulnerable. The vulnerability is in the core parsing logic.

⚠️ 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 crash and denial of service due to out-of-memory conditions from processing ~10MB strings with Unicode characters.

🟠

Likely Case

Significant performance degradation and event loop blocking from processing large duration strings, leading to service disruption.

🟢

If Mitigated

Minimal impact with proper input validation and rate limiting in place before vulnerable code execution.

🌐 Internet-Facing: HIGH - Public APIs accepting user input for duration parsing could be directly targeted with malicious strings.
🏢 Internal Only: MEDIUM - Internal services could be affected by malicious or malformed inputs from authenticated users.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires ability to provide input to parse-duration function. No authentication bypass needed if application accepts external input.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.1.3

Vendor Advisory: https://github.com/jkroso/parse-duration/security/advisories/GHSA-hcrg-fc28-fcg5

Restart Required: No

Instructions:

1. Update parse-duration dependency to version 2.1.3 or later. 2. Run 'npm update parse-duration' or update package.json to '^2.1.3'. 3. Test application functionality with duration parsing.

🔧 Temporary Workarounds

Input validation and sanitization

all

Implement strict input validation to reject or truncate excessively long duration strings before passing to parse-duration.

Rate limiting

all

Implement rate limiting on endpoints that use parse-duration to prevent rapid exploitation attempts.

🧯 If You Can't Patch

  • Implement strict input validation to reject strings longer than reasonable duration formats (e.g., >100 characters).
  • Wrap parse-duration calls in timeouts or worker threads to prevent event loop blocking.

🔍 How to Verify

Check if Vulnerable:

Check package.json or package-lock.json for parse-duration version <2.1.3. Run 'npm list parse-duration' to see installed version.

Check Version:

npm list parse-duration | grep parse-duration

Verify Fix Applied:

Confirm parse-duration version is 2.1.3 or higher using 'npm list parse-duration'. Test with known problematic large duration strings.

📡 Detection & Monitoring

Log Indicators:

  • High memory usage spikes
  • Application crashes with out-of-memory errors
  • Unusually long response times for duration parsing endpoints

Network Indicators:

  • Repeated requests with unusually long string parameters to duration-related endpoints

SIEM Query:

source=application_logs AND ("out of memory" OR "heap out of memory") AND process="node"

🔗 References

📤 Share & Export