CVE-2009-3724: Cross-site scripting in markdown2 for python
Summary
CVE-2009-3724: Cross-site scripting in markdown2 for python. Affects markdown2 versions < 1.0.1.14. Fixed in 1.0.1.14. 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
markdown2 is a Python library used for converting Markdown text into HTML. It provides a simple and efficient way to process and render Markdown content. However, versions before 1.0.1.14 of markdown2 are vulnerable to multiple cross-site scripting (XSS) issues.
Vulnerability Detail
The vulnerability in markdown2 allows an attacker to inject malicious code into the generated HTML output. This can lead to various security risks, such as stealing sensitive user information, performing unauthorized actions on behalf of the user, or manipulating the appearance and functionality of the rendered content. The vulnerability is classified as CWE-79, which refers to improper neutralization of input during web page generation.
How To Fix
Latest published version: 2.5.5 as of 23 Oct 2026
pip install --upgrade "markdown2==2.5.5"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.0.1.14
This is the first release that contains the fix.
pip install --upgrade "markdown2==1.0.1.14"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading to the latest version is not feasible at the moment, you can apply a workaround to mitigate the risk of XSS attacks. One possible workaround is to sanitize the input before passing it to the markdown2 library. Here's an example of how you can sanitize user input using the bleach library:
import bleach
input_text = '<script>alert("XSS attack")</script>' sanitized_text = bleach.clean(input_text)
Pass the sanitized text to markdown2
html_output = markdown2.markdown(sanitized_text)
Conclusion
In conclusion, markdown2 versions before 1.0.1.14 are vulnerable to cross-site scripting (XSS) attacks. To mitigate the risk, it is recommended to upgrade to the latest version of markdown2 or apply the provided workaround. Additionally, you can use Vulert's playground to check if your application is affected by this vulnerability. For further support, contact DevNack.com.
See every vulnerability recorded for markdown2 →
FAQ
markdown2 is a Python library used for converting Markdown text into HTML. It provides a simple and efficient way to process and render Markdown content.
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 can lead to various security risks, such as stealing sensitive user information or manipulating the appearance and functionality of the rendered content.
You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply upload your Pipfile.lock file and Vulert will analyze it for open-source vulnerabilities in real-time.
The CVSS score of this vulnerability is 6.1, indicating a moderate severity level.
For further support on vulnerability remediation, you can reach out to info@devnack.com. They can provide guidance and assistance in addressing the vulnerability in your application.
Related vulnerabilities
Recent vulnerabilities recorded for markdown2.