CVE-2021-23648: Cross-site Scripting in sanitize-url
Summary
CVE-2021-23648: Cross-site Scripting in sanitize-url. Affects @braintree/sanitize-url versions < 6.0.0. Fixed in 6.0.0. How to fix ↓
Also tracked for
- node-mermaid · Debian:11
The same CVE-2021-23648 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
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 package @braintree/sanitize-url is an npm package that provides a function called sanitizeUrl. This function is used for sanitizing URLs by removing any potentially malicious content. The package is commonly used in web applications to ensure that user-provided URLs are safe to use. However, versions of the package before 6.0.0 are vulnerable to a Cross-site Scripting (XSS) attack due to improper sanitization in the sanitizeUrl function.
Vulnerability Detail
The vulnerability in @braintree/sanitize-url allows an attacker to inject malicious scripts into a sanitized URL, which can then be executed by unsuspecting users. This can lead to various security risks, such as stealing sensitive information, performing actions on behalf of the user, or redirecting the user to malicious websites. The vulnerability is rated as MODERATE severity with a CVSS score of 5.4.
How To Fix
Minimum fixed version
6.0.0
This is the first release that contains the fix.
npm install @braintree/sanitize-url@6.0.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is essential to update the package to the fixed version to mitigate the risk of XSS attacks.
Conclusion
The @braintree/sanitize-url package before version 6.0.0 is vulnerable to Cross-site Scripting (XSS) attacks. It is crucial for developers to update their dependencies and use the fixed version to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for @braintree/sanitize-url →
FAQ
@braintree/sanitize-url is an npm package used for sanitizing URLs in web applications.
Cross-site Scripting (XSS) is a type of security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users.
This vulnerability allows an attacker to execute arbitrary scripts in the context of a user's browser, potentially leading to unauthorized actions or data theft.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply upload your package-lock.json file and Vulert will analyze it for vulnerabilities.
Yes, updating the @braintree/sanitize-url package to version 6.0.0 or later will fix this vulnerability.
References
Related vulnerabilities
Recent vulnerabilities recorded for @braintree/sanitize-url.