Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. marked
  4. ›
  5. CVE-2022-21680

CVE-2022-21680: Inefficient Regular Expression Complexity

January 14, 2022 (updated November 7, 2023)

The regular expression block.def may cause catastrophic backtracking against some strings and lead to a regular expression denial of service (ReDoS). Anyone who runs untrusted markdown through a vulnerable version of marked and does not use a worker with a time limit may be affected. This issue is patched As a workaround, avoid running untrusted markdown through marked or run marked on a worker thread and set a reasonable time limit to prevent draining resources.

References

  • github.com/markedjs/marked/commit/c4a3ccd344b6929afa8a1d50ac54a721e57012c0
  • github.com/markedjs/marked/releases/tag/v4.0.10
  • github.com/markedjs/marked/security/advisories/GHSA-rrrm-qjm4-v8hf
  • nvd.nist.gov/vuln/detail/CVE-2022-21680

Code Behaviors & Features

Detect and mitigate CVE-2022-21680 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 4.0.10

Fixed versions

  • 4.0.10

Solution

Upgrade to version 4.0.10 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-1333: Inefficient Regular Expression Complexity

Source file

npm/marked/CVE-2022-21680.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:16:03 +0000.