CVE-2009-3724: Cross-site scripting in markdown2 for python

markdown2 Updated 02 Oct 2025

Summary

21/04/2022
Yes i
Moderate
6.1

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 ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

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 →

Share this vulnerability

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.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback