Security Vulnerability Report
中文
CVE-2026-33672 CVSS 5.3 MEDIUM

CVE-2026-33672

Published: 2026-03-26 22:16:30
Last Modified: 2026-04-01 13:44:53

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.

CVSS Details

CVSS Score
5.3
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Configurations (Affected Products)

cpe:2.3:a:jonschlinkert:picomatch:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:jonschlinkert:picomatch:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:jonschlinkert:picomatch:*:*:*:*:*:node.js:*:* - VULNERABLE
Picomatch < 4.0.4
Picomatch < 3.0.2
Picomatch < 2.3.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// PoC for CVE-2026-33672 // Demonstrating method name injection via POSIX bracket expressions const pm = require('picomatch'); // A maliciously crafted glob pattern targeting the 'constructor' property const maliciousPattern = '[[:constructor:]]'; try { // The library attempts to resolve [[:constructor:]] by looking up Object.prototype.constructor // and converting it to a string, injecting it into the regex. // This results in a broken regex or logic bypass. const isMatch = pm(maliciousPattern); console.log("Testing pattern:", maliciousPattern); // Depending on the specific implementation details and the string representation of the method, // this might match unintended strings or throw an error during compilation. console.log("Match result for 'function Object()':", isMatch('function Object() { [native code] }')); // This demonstrates the injection vulnerability } catch (e) { console.error("Error triggered by PoC:", e.message); }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-33672", "sourceIdentifier": "[email protected]", "published": "2026-03-26T22:16:30.387", "lastModified": "2026-04-01T13:44:53.397", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}, {"lang": "es", "value": "Picomatch es un comparador de globs escrito en JavaScript. Las versiones anteriores a 4.0.4, 3.0.2 y 2.3.2 son vulnerables a una vulnerabilidad de inyección de métodos que afecta al objeto `POSIX_REGEX_SOURCE`. Debido a que el objeto hereda de `Object.prototype`, las expresiones de corchetes POSIX especialmente diseñadas (por ejemplo, '[[:constructor:]]') pueden hacer referencia a nombres de métodos heredados. Estos métodos se convierten implícitamente en cadenas y se inyectan en la expresión regular generada. Esto conduce a un comportamiento incorrecto de coincidencia de globs (impacto en la integridad), donde los patrones pueden coincidir con nombres de archivo no deseados. El problema no permite la ejecución remota de código, pero puede causar errores lógicos relevantes para la seguridad en aplicaciones que dependen de la coincidencia de globs para el filtrado, la validación o el control de acceso. Todos los usuarios de las versiones afectadas de `picomatch` que procesan patrones de glob no confiables o controlados por el usuario están potencialmente afectados. Este problema se corrige en picomatch 4.0.4, 3.0.2 y 2.3.2. Los usuarios deben actualizar a una de estas versiones o posteriores, dependiendo de su línea de lanzamiento compatible. Si la actualización no es posible de inmediato, evite pasar patrones de glob no confiables a picomatch. Las posibles mitigaciones incluyen sanear o rechazar patrones de glob no confiables, especialmente aquellos que contienen clases de caracteres POSIX como '[[:...:]]'; evitar el uso de expresiones de corchetes POSIX si hay entrada de usuario involucrada; y parchear manualmente la biblioteca modificando `POSIX_REGEX_SOURCE` para usar un prototipo nulo."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-1321"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:jonschlinkert:picomatch:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "2.3.2", "matchCriteriaId": "6148465C-6A83-4B20-82ED-6A4716A9715A"}, {"vulnerable": true, "criteria": "cpe:2.3:a:jonschlinkert:picomatch:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "3.0.0", "versionEndExcluding": "3.0.2", "matchCriteriaId": "9A206521-842F-4F49-8128-4A115190B763"}, {"vulnerable": true, "criteria": "cpe:2.3:a:jonschlinkert:picomatch:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "4.0.0", "versionEndExcluding": "4.0.4", "matchCriteriaId": "66F51752-C949-46F4-A543-43DD20B4A98B"}]}]}], "references": [{"url": "https://github.com/micromatch/picomatch/commit/4516eb521f13a46b2fe1a1d2c9ef6b20ddc0e903", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/micr ... (truncated)