GHSA-3v7f-55p6-f55p CVE-2026-33672
Picomatch: Method Injection in POSIX Character Classes causes incorrect Glob Matching
- Severity
- 5.3 / 10
- Medium · CVSS 3.1
- Exploit chance (EPSS)
- 0.43%
- Chance of exploitation in the next 30 days. Higher than 36.84% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-1321 Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
- Fix
4.0.4- Upgrade picomatch to this version or later
Description
Impact
picomatch is vulnerable to a method injection vulnerability (CWE-1321) affecting the POSIX_REGEX_SOURCE object. Because the object inherits from Object.prototype, specially crafted POSIX bracket expressions (e.g., [[:constructor:]]) can reference inherited method names. These methods are implicitly converted to strings and injected into the generated regular expression.
This leads to incorrect glob matching behavior (integrity impact), where patterns may match unintended filenames. The issue does not enable remote code execution, but it can cause security-relevant logic errors in applications that rely on glob matching for filtering, validation, or access control.
All users of affected picomatch versions that process untrusted or user-controlled glob patterns are potentially impacted.
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:
-
Sanitizing or rejecting untrusted glob patterns, especially those containing POSIX character classes like
[[:...:]]. -
Avoiding the use of POSIX bracket expressions if user input is involved.
-
Manually patching the library by modifying
POSIX_REGEX_SOURCEto use a null prototype:const POSIX_REGEX_SOURCE = { __proto__: null, alnum: 'a-zA-Z0-9', alpha: 'a-zA-Z', // ... rest unchanged };
Resources
- fix for similar issue: https://github.com/micromatch/picomatch/pull/144
- picomatch repository https://github.com/micromatch/picomatch
Affected versions
npm
| Package | Vulnerable | Fixed in |
|---|---|---|
| picomatch | >= 4.0.0, < 4.0.4 |
4.0.4 |
| picomatch | >= 3.0.0, < 3.0.2 |
3.0.2 |
| picomatch | < 2.3.2 |
2.3.2 |
| picomatch | >= 4.0.0, < 4.0.4 |
4.0.4 |
| picomatch | >= 3.0.0, < 3.0.2 |
3.0.2 |
| picomatch | < 2.3.2 |
2.3.2 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
picomatch npm → 4.0.4
- npm
npm install picomatch@4.0.4- yarn
yarn add picomatch@4.0.4- pnpm
pnpm add picomatch@4.0.4
Severity breakdown
CVSS 3.1 5.3
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- Low
- Availability
- None
Weakness
CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.
How to prevent it
- Implementation: By freezing the object prototype first (for example, Object.freeze(Object.prototype)), modification of the prototype becomes impossible.
- Architecture and Design: By blocking modifications of attributes that resolve to object prototype, such as proto or prototype, this weakness can be mitigated.
- Implementation: When handling untrusted objects, validating using a schema can be used.
- Implementation: By using an object without prototypes (via Object.create(null) ), adding object prototype attributes by accessing the prototype via the special attributes becomes impossible, mitigating this weakness.
- Implementation: Map can be used instead of objects in most cases. If Map methods are used instead of object attributes, it is not possible to access the object prototype or modify it.
References
Advisories
Fixes and patches
Packages
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-c2c7-rcm5-vvqj Picomatch has a ReDoS vulnerability via extglob quantifiers | High | Also affects picomatch |
| GHSA-6wvx-3r32-xmcg Forge: Prototype Pollution in forge.http cookie handling via a malicious Set-Cookie | Medium | Same weakness, CWE-1321 |
| GHSA-7648-jmwf-vw7j systeminformation has prototype pollution in `networkStats()` via the interface name | Medium | Same weakness, CWE-1321 |
| GHSA-m2m5-rw3w-cwmj ApostropheCMS: Client-side Prototype Pollution in apos.http.parseQuery leading to DOM-based XSS against authenticated users | Medium | Same weakness, CWE-1321 |
| GHSA-j5rq-xfvr-p969 ApostropheCMS: Authenticated projection-exclusion prototype-member deletion in @apostrophecms/db-connect causes process-wide denial of service | High | Same weakness, CWE-1321 |
| GHSA-97rh-rhh2-7vjv Payload: Remote Code Execution through first-register | High | Same weakness, CWE-1321 |
| GHSA-4q55-j62x-fr9h devalue: Malformed null-prototype object keys bypass __proto__ rejection via property-key coercion | Medium | Same weakness, CWE-1321 |
| GHSA-x97p-jq2g-jp4f Axios: Prototype Pollution Gadget in axios toFormData Options | High | Same weakness, CWE-1321 |
Credits: ByamB4, danez, doowb
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor