CVE-2024-4067

Regular Expression Denial of Service in micromatch

MEDIUM 5.3

At a glance

Source
NVD
EPSS
EPSS 1.43 % · percentile 73 ()
State
PUBLISHED
Published
Updated
Assigner
Checkmarx
NVD status
Analyzed

Description

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.

Weaknesses (CWE)

  • CWE-1333 — Inefficient Regular Expression Complexity

References

Scores

VersionScoreVectorScored by
CVSS 3.1MEDIUM 5.3CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LCheckmarx
CVSS 3.1MEDIUM 5.3CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LNVD · 596c5446-0ce5-4ba2-aa66-48b3b757a647 (Secondary)
CVSS 3.1MEDIUM 5.3CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:LNVD · nvd@nist.gov (Primary)

Advisories

European references

CERT-FR advisories

Affected configurations (NVD CPE)

Affected products

ProductVersions
micromatch · micromatchaffected 0 < 4.0.8 ; unaffected 4.0.8

Sources

SourceLicence
CVE List (CVEProject cvelistV5)CVE Program Terms of Use
EPSS (FIRST.org)FIRST — attribution requested
ENISA EUVDENISA — reproduction authorised, source acknowledged
CERT-FR (ANSSI)Licence Ouverte / Etalab 2.0
NVD (NIST) via fkie-cad/nvd-json-data-feedsPublic domain — this product uses data from the NVD API but is not endorsed or certified by the NVD