CVE-2021-43308: Markdown link extractor Denial of Service Vulnerability

LOW
Advisory Identifier: GHSA-mmh6-m7v9-5956
CWE-1333
Published
Advisory Summary

CVE-2021-43308 is a LOW denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Markdown link extractor libraries in the npm ecosystem. The issue involves regular expression denial of service in markdown-link-extractor. Remediation is available by upgrading affected packages to version 3.0.2, 4.0.1.

CVE-2021-43308 at a Glance

CVE Identifier CVE-2021-43308
GHSA Identifier GHSA-mmh6-m7v9-5956
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Markdown link extractor
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2021-43308

To remediate this vulnerability, upgrade all affected Markdown link extractor 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-link-extractor fixed: 3.0.2
npm install markdown-link-extractor@3.0.2
markdown-link-extractor fixed: 4.0.1
npm install markdown-link-extractor@4.0.1
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-link-extractor

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2021-43308, inspect your project dependencies using npm:

npm ls markdown-link-extractor

Analyze the terminal output to locate any version of Markdown link extractor in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.2), your application is affected.

Note: The npm ls markdown-link-extractor 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-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Markdown link extractor, 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

An exponential ReDoS (Regular Expression Denial of Service) can be triggered in the markdown-link-extractor npm package, when an attacker is able to supply arbitrary input to the module's exported function

CVE-2021-43308 Affected Markdown link extractor Versions

2 component(s)
Fixed Versions:
3.0.24.0.1
Product / Package Ecosystem Affected Versions Fixed Version
markdown-link-extractor
npm
< 3.0.2
3.0.2
markdown-link-extractor
npm
≥ 4.0.0
< 4.0.1
4.0.1

References

Frequently Asked Questions

What is CVE-2021-43308?
CVE-2021-43308 is a security vulnerability in Markdown link extractor involving Regular expression denial of service in markdown-link-extractor under CWE-1333: Inefficient Regular Expression Complexity.
Which Markdown link extractor versions are affected?
Affected versions include releases prior to 3.0.2, 4.0.1 across affected packages: markdown-link-extractor.
What version fixes CVE-2021-43308?
Upgrading to 3.0.2, 4.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is markdown-link-extractor affected?
Yes, markdown-link-extractor is affected in releases prior to 3.0.2, 4.0.1. Upgrade your dependency to 3.0.2, 4.0.1 or later.
What CWE is associated with CVE-2021-43308?
CVE-2021-43308 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check npm dependencies for CVE-2021-43308?
Run the dependency tree command: 'npm ls markdown-link-extractor'. 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-mmh6-m7v9-5956",
  "modified" : "2022-06-03T22:25:16Z",
  "published" : "2022-06-03T00:01:00Z",
  "aliases" : [ "CVE-2021-43308" ],
  "summary" : "Regular expression denial of service in markdown-link-extractor",
  "details" : "An exponential ReDoS (Regular Expression Denial of Service) can be triggered in the markdown-link-extractor npm package, when an attacker is able to supply arbitrary input to the module's exported function",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "markdown-link-extractor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "markdown-link-extractor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-43308"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tcort/markdown-link-extractor"
  }, {
    "type" : "WEB",
    "url" : "https://research.jfrog.com/vulnerabilities/markdown-link-extractor-redos-xray-211350"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-03T22:25:16Z",
    "nvd_published_at" : "2022-06-02T14:15:00Z"
  }
}