Denial of Service Vulnerability in python-markdown2 Package

python-markdown2 Updated 02 Oct 2025

Summary

03/03/2021
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2021-26813: markdown2 >=1.0.1.18, fixed in 2.4.0, is affected by a regular expression denial of service vulnerability. Affects python-markdown2 versions < 2.3.10-1.1. Fixed in 2.3.10-1.1. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The python-markdown2 package is a popular Python library that allows users to convert Markdown text into HTML. It is widely used due to its simplicity and flexibility, enabling developers to easily integrate Markdown processing into their applications. However, a vulnerability has been identified in versions of markdown2 prior to 2.4.0, which can lead to performance issues when processing malicious input.

Vulnerability Detail

The vulnerability in question is a regular expression denial of service (ReDoS) issue present in markdown2 versions >=1.0.1.18 and fixed in version 2.4.0. This vulnerability arises when an attacker provides a specially crafted string that exploits the regex patterns used in the markdown2 processing. The result can be significant delays or even crashes in the application, making it difficult for legitimate users to process Markdown content. This can lead to service disruptions and potential denial of service.

How To Fix

Minimum fixed version

2.3.10-1.1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-markdown2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can validate and sanitize input strings before processing them with markdown2 to mitigate the risk of denial of service. This can be done by implementing input length checks and rejecting overly complex or long strings.

Conclusion

The python-markdown2 package has a vulnerability that can lead to denial of service due to regex processing issues. It is crucial to update to version 2.4.0 or later to protect your applications from potential disruptions. Additionally, consider using Vulert for ongoing vulnerability monitoring.

See every vulnerability recorded for python-markdown2 →

Share this vulnerability

FAQ

The vulnerability can lead to significant delays in processing Markdown content, potentially causing denial of service for users.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Versions of python-markdown2 prior to 2.4.0 are affected by this vulnerability.

Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities using just a manifest file like package-lock.json.

If an immediate update is not possible, implement input validation and sanitization as a temporary measure to mitigate the risk.

Related vulnerabilities

Recent vulnerabilities recorded for python-markdown2.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

2.3.10-1.1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-markdown2

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