Skip to main content

CVE-2022-21670: CWE-400: Uncontrolled Resource Consumption in markdown-it markdown-it

Medium
Published: Mon Jan 10 2022 (01/10/2022, 20:40:10 UTC)
Source: CVE
Vendor/Project: markdown-it
Product: markdown-it

Description

markdown-it is a Markdown parser. Prior to version 1.3.2, special patterns with length greater than 50 thousand characterss could slow down the parser significantly. Users should upgrade to version 12.3.2 to receive a patch. There are no known workarounds aside from upgrading.

AI-Powered Analysis

AILast updated: 06/22/2025, 04:20:05 UTC

Technical Analysis

CVE-2022-21670 is a vulnerability classified under CWE-400 (Uncontrolled Resource Consumption) affecting the markdown-it library, a popular Markdown parser widely used in web applications and development tools. The issue exists in versions prior to 12.3.2, where specially crafted Markdown input patterns exceeding 50,000 characters can cause the parser to slow down significantly. This slowdown is due to excessive resource consumption during parsing, which can lead to denial-of-service (DoS) conditions by exhausting CPU and memory resources. The vulnerability does not require authentication or user interaction beyond submitting the malicious Markdown content to the parser. There are no known workarounds other than upgrading to version 12.3.2 or later, where the issue has been patched. No exploits have been reported in the wild to date, but the nature of the vulnerability makes it a potential vector for DoS attacks against services relying on markdown-it for content rendering or processing.

Potential Impact

For European organizations, the primary impact of CVE-2022-21670 is the risk of denial-of-service attacks targeting web applications, content management systems, or developer tools that incorporate vulnerable versions of markdown-it. This can lead to service degradation or outages, affecting availability and potentially disrupting business operations. Organizations that rely on markdown-it for user-generated content rendering, such as forums, documentation platforms, or collaborative tools, are particularly at risk. While the vulnerability does not directly compromise confidentiality or integrity, the availability impact can indirectly affect operational continuity and user trust. Given the widespread use of markdown-it in open-source projects and commercial products, European entities in sectors like technology, media, education, and government could face increased exposure if they have not applied the patch. The absence of known exploits reduces immediate risk, but the ease of triggering the vulnerability by submitting crafted Markdown content means attackers could exploit it opportunistically or as part of larger attack campaigns.

Mitigation Recommendations

The most effective mitigation is to upgrade all instances of markdown-it to version 12.3.2 or later, ensuring the vulnerability is patched. Organizations should conduct an inventory of software and services that use markdown-it, including indirect dependencies in their software supply chain, to identify vulnerable versions. Implement input validation and size limits on Markdown content submissions to restrict excessively large inputs that could trigger resource exhaustion. Employ rate limiting and web application firewalls (WAFs) to detect and block abnormal request patterns that may indicate exploitation attempts. Monitoring resource usage and application logs for unusual spikes during Markdown parsing can help detect attempted attacks. For environments where immediate upgrading is not feasible, isolating markdown-it processing in sandboxed or resource-limited containers can reduce the impact of potential exploitation. Finally, maintain awareness of updates from markdown-it and related projects to promptly apply future security patches.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2021-11-16T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9848c4522896dcbf612a

Added to database: 5/21/2025, 9:09:28 AM

Last enriched: 6/22/2025, 4:20:05 AM

Last updated: 8/1/2025, 7:06:01 AM

Views: 14

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats