You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
picomatch is vulnerable to Regular Expression Denial of Service (ReDoS) when processing crafted extglob patterns. Certain patterns using extglob quantifiers such as +() and *(), especially when combined with overlapping alternatives or nested extglobs, are compiled into regular expressions that can exhibit catastrophic backtracking on non-matching input.
Examples of problematic patterns include +(a|aa), +(*|?), +(+(a)), *(+(a)), and +(+(+(a))). In local reproduction, these patterns caused multi-second event-loop blocking with relatively short inputs. For example, +(a|aa) compiled to ^(?:(?=.)(?:a|aa)+)$ and took about 2 seconds to reject a 41-character non-matching input, while nested patterns such as +(+(a)) and *(+(a)) took around 29 seconds to reject a 33-character input on a modern M1 MacBook.
Applications are impacted when they allow untrusted users to supply glob patterns that are passed to picomatch for compilation or matching. In those cases, an attacker can cause excessive CPU consumption and block the Node.js event loop, resulting in a denial of service. Applications that only use trusted, developer-controlled glob patterns are much less likely to be exposed in a security-relevant way.
Patches
This issue is fixed in picomatch 4.0.4, 3.0.2 and 2.3.2.
Users should upgrade to one of these versions or later, depending on their supported release line.
Workarounds
If upgrading is not immediately possible, avoid passing untrusted glob patterns to picomatch.
Possible mitigations include:
disable extglob support for untrusted patterns by using noextglob: true
reject or sanitize patterns containing nested extglobs or extglob quantifiers such as +() and *()
enforce strict allowlists for accepted pattern syntax
run matching in an isolated worker or separate process with time and resource limits
apply application-level request throttling and input validation for any endpoint that accepts glob patterns
The vulnerability is in pkg:npm/picomatch@4.0.3, found in artifacts pkg:oci/devguard-documentation?repository_url=ghcr.io/l3montree-dev/devguard-documentation&arch=amd64&tag=main-amd64, pkg:oci/l3montree-cybersecurity/devguard/devguard-documentation.
Recommended fix
Upgrade to version 4.0.4 or later.
# Update all vulnerable npm packages
npm audit fix
# Update only this package
npm install picomatch@4.0.4
Additional guidance for mitigating vulnerabilities
The vulnerability is in a direct dependency of your project.
EPSS
0.41 %
The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.
EXPLOIT
Not available
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database. There are no script kiddies exploiting this vulnerability.
CVSS-BE
7.5
- Exploiting this vulnerability significantly impacts availability.
CVSS-B
7.5
- The vulnerability can be exploited over the network without needing physical access. - It is easy for an attacker to exploit this vulnerability. - An attacker does not need any special privileges or access rights. - No user interaction is needed for the attacker to exploit this vulnerability. - The impact is confined to the system where the vulnerability exists. - There is a high impact on the availability of the system.
GHSA-c2c7-rcm5-vvqj found in npm/picomatch@4.0.3
Important
Risk:
3.46 (Low)CVSS:
7.5Description
Impact
picomatchis vulnerable to Regular Expression Denial of Service (ReDoS) when processing crafted extglob patterns. Certain patterns using extglob quantifiers such as+()and*(), especially when combined with overlapping alternatives or nested extglobs, are compiled into regular expressions that can exhibit catastrophic backtracking on non-matching input.Examples of problematic patterns include
+(a|aa),+(*|?),+(+(a)),*(+(a)), and+(+(+(a))). In local reproduction, these patterns caused multi-second event-loop blocking with relatively short inputs. For example,+(a|aa)compiled to^(?:(?=.)(?:a|aa)+)$and took about 2 seconds to reject a 41-character non-matching input, while nested patterns such as+(+(a))and*(+(a))took around 29 seconds to reject a 33-character input on a modern M1 MacBook.Applications are impacted when they allow untrusted users to supply glob patterns that are passed to
picomatchfor compilation or matching. In those cases, an attacker can cause excessive CPU consumption and block the Node.js event loop, resulting in a denial of service. Applications that only use trusted, developer-controlled glob patterns are much less likely to be exposed in a security-relevant way.Patches
This issue is fixed in picomatch 4.0.4, 3.0.2 and 2.3.2.
Users should upgrade to one of these versions or later, depending on their supported release line.
Workarounds
If upgrading is not immediately possible, avoid passing untrusted glob patterns to
picomatch.Possible mitigations include:
noextglob: true+()and*()Resources
lib/parse.jsandlib/constants.jsare involved in generating the vulnerable regex formsmicromatch)path-to-regexp)Affected component
The vulnerability is in
pkg:npm/picomatch@4.0.3, found in artifactspkg:oci/devguard-documentation?repository_url=ghcr.io/l3montree-dev/devguard-documentation&arch=amd64&tag=main-amd64,pkg:oci/l3montree-cybersecurity/devguard/devguard-documentation.Recommended fix
Upgrade to version 4.0.4 or later.
Additional guidance for mitigating vulnerabilities
Visit our guides on devguard.org
See more details...
Path to component
%%{init: { 'theme':'base', 'themeVariables': { 'primaryColor': '#F3F3F3', 'primaryTextColor': '#0D1117', 'primaryBorderColor': '#999999', 'lineColor': '#999999', 'secondaryColor': '#ffffff', 'tertiaryColor': '#ffffff' } }}%% flowchart TD Your_application(["Your application"]) --- pkg_npm_picomatch_4_0_3(["pkg:npm/picomatch\@4.0.3"]) classDef default stroke-width:2px10.41 %Not available7.57.5- It is easy for an attacker to exploit this vulnerability.
- An attacker does not need any special privileges or access rights.
- No user interaction is needed for the attacker to exploit this vulnerability.
- The impact is confined to the system where the vulnerability exists.
- There is a high impact on the availability of the system.
More details can be found in DevGuard
Interact with this vulnerability
You can use the following slash commands to interact with this vulnerability:
👍 Reply with this to acknowledge and accept the identified risk.
🔁 Reopen the risk: Use this command to reopen a previously closed or accepted vulnerability.