GHSA-x6m6-5hrf-fh6r: Markdown it toc and anchor Denial of Service Vulnerability

HIGH
CVSS 7.5
CWE-400
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-x6m6-5hrf-fh6r
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Markdown it toc and anchor
Package Ecosystem npm
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (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.

markdown-it-toc-and-anchor fixed: 4.2.0
npm install markdown-it-toc-and-anchor@4.2.0
Verify Direct and Transitive Dependencies

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

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. ## Recommendation No fix is currently available. Consider using an alternative module until a fix is made available.

GHSA-x6m6-5hrf-fh6r Affected Markdown it toc and anchor Versions

1 component(s)
Fixed Versions:
4.2.0
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?
GHSA-x6m6-5hrf-fh6r is a security vulnerability in Markdown it toc and anchor involving Denial of Service in markdown-it-toc-and-anchor under CWE-400: Uncontrolled Resource Consumption.
Which Markdown it toc and anchor versions are affected?
Affected versions include releases prior to 4.2.0 across affected packages: markdown-it-toc-and-anchor.
What version fixes GHSA-x6m6-5hrf-fh6r?
Upgrading to 4.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is markdown-it-toc-and-anchor affected?
Yes, markdown-it-toc-and-anchor is affected in releases prior to 4.2.0. Upgrade your dependency to 4.2.0 or later.
What is the CVSS score of GHSA-x6m6-5hrf-fh6r?
GHSA-x6m6-5hrf-fh6r has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with GHSA-x6m6-5hrf-fh6r?
GHSA-x6m6-5hrf-fh6r is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for GHSA-x6m6-5hrf-fh6r?
Run the dependency tree command: 'npm ls markdown-it-toc-and-anchor'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}