GHSA-x6m6-5hrf-fh6r: Markdown it toc and anchor Denial of Service Vulnerability
HIGHGHSA-x6m6-5hrf-fh6r is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Markdown it toc and anchor libraries in the npm ecosystem. The issue involves denial of service in markdown-it-toc-and-anchor. Remediation is available by upgrading affected packages to version 4.2.0.
GHSA-x6m6-5hrf-fh6r at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix GHSA-x6m6-5hrf-fh6r
To remediate this vulnerability, upgrade all affected Markdown it toc and anchor dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install markdown-it-toc-and-anchor@4.2.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls markdown-it-toc-and-anchor
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-x6m6-5hrf-fh6r, inspect your project dependencies using npm:
npm ls markdown-it-toc-and-anchor
Analyze the terminal output to locate any version of Markdown it toc and anchor in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.2.0), your application is affected.
Note: The npm ls markdown-it-toc-and-anchor command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Markdown it toc and anchor, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-x6m6-5hrf-fh6r Affected Markdown it toc and anchor Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
markdown-it-toc-and-anchor
|
npm |
< 4.2.0
|
4.2.0
|
References
Frequently Asked Questions
What is GHSA-x6m6-5hrf-fh6r?
Which Markdown it toc and anchor versions are affected?
What version fixes GHSA-x6m6-5hrf-fh6r?
Is markdown-it-toc-and-anchor affected?
What is the CVSS score of GHSA-x6m6-5hrf-fh6r?
What CWE is associated with GHSA-x6m6-5hrf-fh6r?
How can I check npm dependencies for GHSA-x6m6-5hrf-fh6r?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-x6m6-5hrf-fh6r",
"modified" : "2023-12-07T22:05:03Z",
"published" : "2020-09-01T21:26:50Z",
"aliases" : [ ],
"summary" : "Denial of Service in markdown-it-toc-and-anchor",
"details" : "All versions of `markdown-it-toc-and-anchor` are vulnerable to Denial of Service. Parsing markdown containing `**text**+\\n@[toc]` causes the application to enter and infinite loop.\n\n\n## Recommendation\n\nNo fix is currently available. Consider using an alternative module until a fix is made available.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "markdown-it-toc-and-anchor"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.2.0"
} ]
} ]
} ],
"references" : [ {
"type" : "PACKAGE",
"url" : "https://github.com/medfreeman/markdown-it-toc-and-anchor"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-MARKDOWNITTOCANDANCHOR-73500"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/749"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T18:34:25Z",
"nvd_published_at" : null
}
}