CVE-2024-4067
Regular Expression Denial of Service in micromatch
Reported by checkmarx · Published May 13, 2024
micromatch is fixed in 4.0.8 (npm)
The NPM package `micromatch` prior to 4.0.8 is vulnerable to Regular Expression Denial of Service (ReDoS). The vulnerability occurs in `micromatch.braces()` in `index.js` because the pattern `.*` will greedily match anything. By passing a malicious payload, the pattern matching will keep backtracking to the input while it doesn't find the closing bracket. As the input size increases, the consumption time will also increase until it causes the application to hang or slow down. There was a merged fix but further testing shows the issue persists. This issue should be mitigated by using a safe pattern that won't start backtracking the regular expression due to greedy matching. This issue was fixed in version 4.0.8.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| micromatch | npm | 4.0.8 |
| gitlab-rails-ce-fips-18.1 | Chainguard | 18.1.6-r15 |
| gitlab-rails-ce-fips-19.0 | Chainguard | 19.0.9-r3 |
| gitlab-rails-ce-fips-18.9 | Chainguard | 18.9.8-r8 |
| opensearch-dashboards-2 | Wolfi | 2.19.1-r3 |
| kubeflow-katib | Chainguard | 0.19.0-r40, 0.19.0-r31 |
| kibana-8 | Chainguard | 8.15.3-r0 |
| arangodb-3.11 | Chainguard | 3.11.14.5-r25 |
| gitlab-rails-ce-19.3 | Chainguard | 19.3.1-r6 |
| semaphore | Chainguard | 2.18.12-r2 |
| py3-captum | Chainguard | 0.9.0-r1 |
| argo-workflows-3.7 | Chainguard | 3.7.13-r2 |
27 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| micromatch | micromatch | 0, 4.0.8 |
| chainguard | gitlab-rails-ce-fips-18.1 | 0 |
| chainguard | gitlab-rails-ce-fips-19.0 | 0 |
| chainguard | gitlab-rails-ce-fips-18.9 | 0 |
| wolfi | opensearch-dashboards-2 | 0 |
| chainguard | kubeflow-katib | 0, 0 |
| chainguard | kibana-8 | 0 |
| chainguard | arangodb-3.11 | 0 |
| jonschlinkert | micromatch | |
| npm | micromatch | 0 |
| chainguard | gitlab-rails-ce-19.3 | 0 |
| chainguard | semaphore | 0 |
| chainguard | py3-captum | 0 |
| micromatch | micromatch | 0 |
| micromatch | micromatch | 4.0.8, 0 |
| chainguard | argo-workflows-3.7 | 0 |
| chainguard | gitlab-rails-ce-fips-18.10 | 0 |
| chainguard | gitlab-rails-ce-fips-19.3 | 0 |
| chainguard | kubeflow-pipelines | 0 |
| chainguard | lerna | 0 |
…and 22 more
Timeline
- May 13, 2024 CVE Published
- May 14, 2024 EPSS Score (30 in total, the first dated here)
- Oct 4, 2024 Coalition ESS Score (14 in total, the first dated here)
- Jan 7, 2026 CVE Updated
- Mar 10, 2026 Security Advisory (22 in total, the first dated here)
- Nov 21, 2026 Distribution Patch (20 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2024-4067
vulnetix vdb fixes CVE-2024-4067
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2024-4067/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/micromatch/micromatch/blob/2c56a8604b68c1099e7bc0f807ce0865a339747a/index.js#L448 url
- https://github.com/micromatch/micromatch/issues/243 url
- https://github.com/micromatch/micromatch/pull/247 url
- https://nvd.nist.gov/vuln/detail/CVE-2024-4067 advisory
- https://github.com/advisories/GHSA-952p-6rrq-rcjv advisory
- https://github.com/micromatch/micromatch/commit/500d5d6f42f0e8dfa1cb5464c6cb420b1b6aaaa0 patch
- https://advisory.checkmarx.net/advisory/CVE-2024-4067 advisory
- https://devhub.checkmarx.com/cve-details/CVE-2024-4067 url
- https://github.com/micromatch/micromatch url