Authorization Bypass Vulnerability in node-url-parse: CVE-2022-0512
Summary
CVE-2022-0512: Authorization Bypass Through User-Controlled Key in NPM url-parse prior to 1.5.6. Affects node-url-parse across 2 version ranges.
< 1.5.3-1+deb11u2
< 9be7ee88afd2bb04e4d5a1a8da9a389ac13f8c40
Fixed in 1.5.3-1+deb11u2. 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
node-url-parse is a popular JavaScript library used for parsing URLs in Node.js applications. It provides a simple interface for extracting components from URLs, making it easier for developers to manipulate and validate URL structures. However, this package has been found to have a critical vulnerability that allows unauthorized access due to improper handling of user-controlled keys.
Vulnerability Detail
CVE-2022-0512 is an authorization bypass vulnerability that affects versions of node-url-parse prior to 1.5.6. The vulnerability arises from the way the library processes user-controlled keys, which can lead to unauthorized access to sensitive data. Attackers can exploit this flaw to manipulate URL parsing, potentially gaining access to restricted resources or executing unauthorized actions within an application. The CVSS score for this vulnerability is 5.3, indicating a moderate level of risk.
How To Fix
Minimum fixed version
1.5.3-1+deb11u2
This is the first release that contains the fix.
sudo apt-get install --only-upgrade node-url-parse
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If immediate upgrading is not feasible, consider implementing input validation to sanitize user-controlled keys before they are processed by the node-url-parse library. This can help mitigate the risk of unauthorized access until a proper update can be applied.
Conclusion
The CVE-2022-0512 vulnerability in the node-url-parse package poses a significant risk due to its potential for unauthorized access. It is crucial for developers using this library to update to the latest version to safeguard their applications. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.
See every vulnerability recorded for node-url-parse →
FAQ
CVE-2022-0512 is a vulnerability in the node-url-parse library that allows for authorization bypass through user-controlled keys.
You can check if your application is affected by using the Vulert playground at Vulert Scanner, which analyzes your package-lock.json file for vulnerabilities.
Exploitation of this vulnerability could allow attackers to gain unauthorized access to sensitive data or perform actions that should be restricted.
You can update the package using the command 'sudo apt-get install node-url-parse' after running 'sudo apt-get update' to ensure you have the latest package information.
Yes, you can implement input validation to sanitize user-controlled keys as a temporary workaround until you can apply the necessary updates.
References
Related vulnerabilities
Recent vulnerabilities recorded for node-url-parse.