Denial of Service Vulnerability in Node-Semver Package
Summary
DEBIAN-CVE-2015-8855: The semver package before 4.3.2 for Node.js allows attackers to cause a denial of service (CPU consumption) via a long version string, aka a "regular expression denial of service (ReDoS).". Affects node-semver versions < 5.3.0-1. Fixed in 5.3.0-1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The node-semver package is a widely used library in Node.js environments that provides semantic versioning utilities. It allows developers to manage version numbers in a consistent manner, ensuring compatibility and proper dependency management. However, prior to version 4.3.2, the package was susceptible to a vulnerability that could lead to denial of service attacks due to inefficient handling of long version strings.
Vulnerability Detail
The vulnerability identified as DEBIAN-CVE-2015-8855 affects the node-semver package versions before 4.3.2. It allows attackers to exploit the package by providing excessively long version strings, which can lead to significant CPU consumption, effectively causing a denial of service (DoS). This is categorized as a regular expression denial of service (ReDoS) attack, where the regular expressions used in the package can be manipulated to consume resources disproportionately, impacting the performance of applications relying on this package.
How To Fix
Minimum fixed version
5.3.0-1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade node-semver
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If immediate updating is not feasible, consider validating version strings before processing them to ensure they do not exceed reasonable lengths, thereby mitigating the risk of triggering the vulnerability.
Conclusion
The node-semver package has a known vulnerability that can lead to denial of service attacks through improper handling of version strings. It is crucial to update to the patched version to mitigate this risk. Additionally, using tools like Vulert can help in monitoring and managing vulnerabilities in your software dependencies effectively.
See every vulnerability recorded for node-semver →
FAQ
The vulnerability allows for denial of service attacks through excessive CPU consumption caused by long version strings.
Versions prior to 4.3.2 are affected by this vulnerability.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
Implement input validation for version strings to limit their length and reduce the risk of triggering the vulnerability.
Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities using just a manifest file like package-lock.json.
References
Related vulnerabilities
Recent vulnerabilities recorded for node-semver.