codemirror@5.62.0 vulnerabilities

Basic configuration for the CodeMirror code editor

Direct Vulnerabilities

Known vulnerabilities in the codemirror package. This does not include vulnerabilities belonging to this package’s dependencies.

How to fix?

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.

Fix for free
VulnerabilityVulnerable Version
  • M
Regular Expression Denial of Service (ReDoS)

codemirror is a versatile text editor implemented in JavaScript for the browser.

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via multiple locations in markdown.js. An attacker can cause excessive resource consumption by submitting a crafted Markdown input that triggers inefficient regular expression processing, causing the editor (or associated service) to freeze the CPU.

Note: The GitHub issue associated with the vulnerability refers to multiple problematic regex patterns; those patterns were introduced, in part, starting from version 2.33.0:

  • /\[[^\]]*\] ?(?:\(|\[)/ introduced in 3.15.0

  • /\[[^\]]*\] ?(?:\(|\[)/ introduced in 3.11.0

  • /\(.*?\)| ?\[.*?\]/ introduced in 5.15.0

  • /^[^> \\]+@(?:[^\\>]|\\.)+>/ introduced in 2.33.0

  • /[^\]]*\](\(.*\)| ?\[.*?\])/ introduced in 5.15.0

While the issue was reported for version 5.17.0, those patterns still exist in recent versions of the package.

How to fix Regular Expression Denial of Service (ReDoS)?

There is no fixed version for codemirror.

*