Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. braces
  4. ›
  5. CVE-2024-4068

CVE-2024-4068: Uncontrolled resource consumption in braces

May 14, 2024 (updated May 29, 2024)

The NPM package braces fails to limit the number of characters it can handle, which could lead to Memory Exhaustion. In lib/parse.js, if a malicious user sends imbalanced braces as input, the parsing will enter a loop, which will cause the program to start allocating heap memory without freeing it at any moment of the loop. Eventually, the JavaScript heap limit is reached, and the program will crash.

References

  • devhub.checkmarx.com/cve-details/CVE-2024-4068
  • github.com/micromatch/braces/commit/415d660c3002d1ab7e63dbf490c9851da80596ff
  • github.com/micromatch/braces/issues/35
  • github.com/micromatch/braces/pull/37
  • github.com/micromatch/braces/pull/40
  • nvd.nist.gov/vuln/detail/CVE-2024-4068

Code Behaviors & Features

Detect and mitigate CVE-2024-4068 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 3.0.3

Fixed versions

  • 3.0.3

Solution

Upgrade to version 3.0.3 or later

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-1050: Excessive Platform Resource Consumption within a Loop
  • CWE-400: Uncontrolled Resource Consumption

Source file

npm/braces/CVE-2024-4068.yml

Spotted a mistake? Edit the file on GitLab.

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

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