Uncontrolled resource consumption in braces
Published 14 May 2024 · Updated 10 Sept 2026
Affected package
- Affected
- <3.0.3
- Fixed in
- 3.0.3
npm install braces@3.0.3Details
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.
Is GHSA-grv7-fg5c-xmjg in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected braces, and gives you the command that fixes it.
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2024-4068
- Linkgithub.com/micromatch/braces/issues/35
- Linkgithub.com/micromatch/braces/pull/37
- Linkgithub.com/micromatch/braces/pull/40
- Linkgithub.com/micromatch/braces/commit/415d660c3002d1ab7e63dbf490c9851da80596ff
- Linkdevhub.checkmarx.com/cve-details/CVE-2024-4068
- Packagegithub.com/micromatch/braces
- Linkgithub.com/micromatch/braces/blob/98414f9f1fabe021736e26836d8306d5de747e0d/lib/parse.js#L308
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.