XSS Vulnerability in node-marked Package
Summary
CVE-2017-1000427: marked version 0.3.6 and earlier is vulnerable to an XSS attack in the data: URI parser. Affects node-marked across 2 version ranges.
< 0.3.9+dfsg-1
< eddec20467c2d10c7769061ee9074e268500966f
Fixed in 0.3.9+dfsg-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-marked package is a popular library used for parsing and rendering Markdown content in Node.js applications. It provides a simple and efficient way to convert Markdown syntax into HTML. However, versions 0.3.6 and earlier of the package are vulnerable to an XSS (Cross-Site Scripting) attack in the data: URI parser.
Vulnerability Detail
The XSS vulnerability in the node-marked package allows an attacker to inject malicious code into the parsed Markdown content, which can be executed by unsuspecting users visiting the rendered HTML. This can lead to various security risks, including unauthorized data access, session hijacking, and defacement of web pages. The vulnerability originates from a lack of proper input sanitization in the data: URI parser.
How To Fix
Minimum fixed version
0.3.9+dfsg-1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade node-marked
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If updating the package is not immediately feasible, a temporary workaround is to manually sanitize the input Markdown content before passing it to the node-marked library. This can be done using a library like DOMPurify to sanitize any user-generated HTML or JavaScript code.
Conclusion
The XSS vulnerability in the node-marked package can have serious security implications for applications that utilize it. It is crucial to update to the fixed version or apply the recommended workaround to protect your application and its users. For further support and assistance in vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for node-marked →
FAQ
XSS (Cross-Site Scripting) is a type of security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users. It occurs when a web application does not properly sanitize user input and allows the execution of untrusted code.
If your application uses the node-marked package and is vulnerable to XSS attacks, it means that an attacker can inject malicious code into the rendered HTML, potentially compromising user data, stealing sensitive information, or performing unauthorized actions on behalf of the user.
While there is no specific known exploit for this vulnerability in the public domain, it is important to address it promptly as XSS vulnerabilities are commonly targeted by attackers.
No, only versions 0.3.6 and earlier of the node-marked package are affected by this XSS vulnerability. It is recommended to update to version 0.3.9+dfsg-1 or later to mitigate the risk.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert analyzes your package-lock.json file to identify any vulnerable dependencies and provides real-time alerts for open-source vulnerabilities.
References
Related vulnerabilities
Recent vulnerabilities recorded for node-marked.