Regular Expression Denial of Service in simple-markdown
Summary
GHSA-4xf9-pgvv-xx67: Regular Expression Denial of Service in simple-markdown. Affects simple-markdown versions < 0.5.2. Fixed in 0.5.2. 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 simple-markdown package is an npm package used for parsing and rendering Markdown text. It provides a simple and efficient way to convert Markdown syntax into HTML or other formats. The package is widely used in various projects and applications.
Vulnerability Detail
The vulnerability in simple-markdown is a Regular Expression Denial of Service (ReDoS) issue. It affects versions prior to 0.5.2. The specific function SimpleMarkdown.defaultInlineParse() has a performance degradation when parsing inline code blocks. This can be exploited by an attacker to cause a denial of service by providing specially crafted input that triggers the slow regex pattern matching, leading to excessive CPU usage and potentially crashing the application. The impact of this vulnerability is moderate.
How To Fix
Minimum fixed version
0.5.2
This is the first release that contains the fix.
npm install simple-markdown@0.5.2
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no specific workaround mentioned for this vulnerability. The recommended solution is to upgrade to the fixed version of the package.
Conclusion
In conclusion, the simple-markdown package prior to version 0.5.2 is vulnerable to a Regular Expression Denial of Service (ReDoS) issue. This can be exploited by an attacker to cause a denial of service. To mitigate the vulnerability, it is crucial to upgrade to version 0.5.2 or later. For further support on vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for simple-markdown →
FAQ
simple-markdown is an npm package used for parsing and rendering Markdown text. It provides a convenient way to convert Markdown syntax into HTML or other formats.
A Regular Expression Denial of Service (ReDoS) vulnerability occurs when a regular expression pattern is susceptible to excessive backtracking, leading to a significant degradation in performance. This can be exploited by an attacker to cause a denial of service by providing specially crafted input that triggers the slow regex pattern matching.
The impact of this vulnerability is moderate. An attacker can exploit the vulnerability to cause a denial of service by consuming excessive CPU resources, potentially leading to application crashes.
To fix the vulnerability, it is recommended to upgrade to version 0.5.2 or later of the simple-markdown package. This version includes the necessary fixes to address the ReDoS issue.
There is no specific workaround mentioned for this vulnerability. The recommended solution is to upgrade to the fixed version of the package.
References
Related vulnerabilities
Recent vulnerabilities recorded for simple-markdown.