Description
Picomatch is a glob matcher written JavaScript. Versions prior to 4.0.4, 3.0.2, and 2.3.2 are vulnerable to a method injection vulnerability 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. 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. 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; and manually patching the library by modifying `POSIX_REGEX_SOURCE` to use a null prototype.
Published: 2026-03-26
Score: 5.3 Medium
EPSS: n/a
KEV: No
Impact: Integrity impact
Action: Upgrade Immediately
AI Analysis

Impact

Picomatch is a glob matcher used in JavaScript projects. Versions before 4.0.4, 3.0.2, and 2.3.2 are vulnerable to a method injection flaw that affects the POSIX_REGEX_SOURCE object. Because that object inherits from Object.prototype, specially crafted POSIX bracket expressions such as [[:constructor:]] can reference inherited method names. Those method names are implicitly cast to strings and injected into the generated regular expression, producing incorrect glob matching. The result is a logic error where a pattern may match filenames that should not be matched, compromising integrity of any filtering, validation, or access‑control logic that relies on picomatch.

Affected Systems

The bug affects the micromatch:picomatch library. All installations that use picomatch versions earlier than 4.0.4 in the 4.x line, earlier than 3.0.2 in the 3.x line, or earlier than 2.3.2 in the 2.x line are impacted. Any package that imports picomatch and processes untrusted or user‑controlled glob patterns is potentially exposed.

Risk and Exploitability

The CVSS score of 5.3 indicates a moderate impact; the EPSS score is not available and the vulnerability is not listed in CISA’s KEV catalog, suggesting it is not widely exploited. The likely attack vector is local or supply‑chain; an attacker who supplies or influences a glob pattern that contains POSIX character classes can trigger the injection. While the flaw does not provide remote code execution or privilege escalation, it can cause unintended matches that may lead to denial of service, bypass of filtering, or other integrity violations within an application that depends on picomatch.

Generated by OpenCVE AI on March 26, 2026 at 23:23 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade picomatch to version 4.0.4, 3.0.2, or 2.3.2 or later depending on your supported release line.
  • If an upgrade cannot be made immediately, refrain from passing user‑controlled glob patterns to picomatch in your application.
  • Sanitize or reject any glob patterns that contain POSIX bracket expressions like [[:...:]] before they reach picomatch.
  • Alternatively, modify the picomatch source by changing POSIX_REGEX_SOURCE to use a null prototype so that inherited methods are not available.
  • Verify that the patched or upgraded library behaves correctly by testing glob matching against known patterns.

Generated by OpenCVE AI on March 26, 2026 at 23:23 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-3v7f-55p6-f55p Picomatch: Method Injection in POSIX Character Classes causes incorrect Glob Matching
History

Fri, 27 Mar 2026 08:45:00 +0000

Type Values Removed Values Added
First Time appeared Micromatch
Micromatch picomatch
Vendors & Products Micromatch
Micromatch picomatch

Thu, 26 Mar 2026 22:00:00 +0000

Type Values Removed Values Added
Description Picomatch is a glob matcher written JavaScript. Versions prior to 4.0.4, 3.0.2, and 2.3.2 are vulnerable to a method injection vulnerability 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. 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. 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; and manually patching the library by modifying `POSIX_REGEX_SOURCE` to use a null prototype.
Title Picomatch: Method Injection in POSIX Character Classes causes incorrect Glob Matching
Weaknesses CWE-1321
References
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N'}


Subscriptions

Micromatch Picomatch
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-03-26T21:39:16.362Z

Reserved: 2026-03-23T16:34:59.930Z

Link: CVE-2026-33672

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-03-26T22:16:30.387

Modified: 2026-03-26T22:16:30.387

Link: CVE-2026-33672

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-03-27T09:23:07Z

Weaknesses