# CVE-2024-4068: braces uncontrolled resource consumption

Source: https://junglewise.ai/threats/cve-2024-4068-braces-uncontrolled-resource-consumption  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-05-14. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2024-4068 · Severity: low · CVSS 3.1 · Published 2024-05-14

braces is a popular Node.js library used for parsing and expanding brace patterns in strings. A malicious attacker can supply specially crafted input with imbalanced braces that causes the parser to enter an infinite loop, consuming memory until the JavaScript process crashes, resulting in denial of service to any application relying on this library.

Technologies: [braces (npm)](https://junglewise.ai/threats/technologies/braces). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2024-4068 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-4068 being exploited in the wild.

**How severe is CVE-2024-4068?** Low severity, with a CVSS score of 3.1, published 14 May 2024.

**Which products and versions are affected?** braces (npm) SEMVER:introduced=0,fixed=3.0.3.

**Is there a fix for CVE-2024-4068?** Yes. braces (npm): upgrade to 3.0.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2024-4068 attacked?** It is attacked over the network.

**Am I affected by CVE-2024-4068?** Check whether you run braces (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- braces (npm): upgrade to 3.0.3 or later

  ```sh
  npm install braces@3.0.3
  ```


## Technical details

The vulnerability is an uncontrolled resource consumption issue (CWE-400) in the parse.js module of braces. When processing imbalanced braces, the parser enters an infinite loop in line 308 that continuously allocates heap memory without freeing it. The vulnerability is triggered by providing malicious input containing unbalanced braces to the parsing function, and requires no authentication or special privileges. An attacker can exploit this remotely by supplying crafted input to cause the JavaScript heap limit to be exceeded, resulting in a denial-of-service crash. The vulnerability was fixed in version 3.0.3.

## Affected products

- micromatch braces before 3.0.3

## Identifiers

- CVE-2024-4068
- GHSA-grv7-fg5c-xmjg

## Timeline

- 2024-05-14: disclosed
- 2024-05-14: patched: Fix released in version 3.0.3

## References

- [https://github.com/micromatch/braces/issues/35](https://github.com/micromatch/braces/issues/35)

## Related threats

- [braces stack overflow in recursive AST walkers](https://junglewise.ai/threats/cve-2026-93687-braces-through-3-0-3-contains-a-stack-overflow-vulnerability-in)
- [braces regular expression denial of service](https://junglewise.ai/threats/cve-2018-1109-braces-regular-expression-denial-of-service)
- [braces regular expression denial of service](https://junglewise.ai/threats/braces-regular-expression-denial-of-service-b7ef8e21)
