CVE-2026-138148 in picomatchinfo

Summary

by MITRE • 11/28/2026

picomatch through 4.0.7 contains a glob filter bypass vulnerability because globstar (**) patterns are compiled without the dotAll flag and fail to match line terminators. Attackers who control file, object key or archive entry names containing newline characters can evade ** deny patterns, causing excluded resources to be included and exposed.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 11/28/2026

The picomatch library, a widely used JavaScript utility for fast glob pattern matching, contains a critical vulnerability in versions through 4.0.7 related to the handling of globstar patterns. Globstar patterns, denoted by double asterisks (**), are designed to match zero or more directories and subdirectories recursively. The core technical flaw lies in how these patterns are compiled internally; specifically, they are processed without the dotAll flag enabled. In regular expression syntax, the dotAll flag causes the dot metacharacter to match line terminators such as newline characters (\n) and carriage returns (\r). Without this flag, standard regex behavior dictates that dots do not match these vertical whitespace characters. Consequently, when picomatch processes a globstar pattern against file paths or object keys containing embedded newlines, it fails to recognize the path continuation across those line breaks. This results in a mismatch where the intended recursive traversal logic is effectively broken at newline boundaries.

This technical deficiency leads directly to a significant security control bypass known as a glob filter evasion vulnerability. In many applications, picomatch is employed to enforce access controls by defining deny lists or exclusion patterns for sensitive files, such as configuration files with extensions like .env or .config. Attackers who can influence file names, object keys in cloud storage services, or entries within archives containing newline characters can exploit this flaw. By inserting a newline character into the filename, an attacker creates a path that visually appears to match the denied pattern but is technically evaluated as non-matching by picomatch due to the unhandled line terminator. For example, if a system denies access to files named .env*, an attacker might name their file .env\n.txt or similar variations containing hidden newlines. The security filter fails to block this request because the regex engine does not see the full intended path structure as a match for the deny rule.

The operational impact of this vulnerability is severe, particularly in contexts where picomatch is used for input validation and resource access control. When an attacker successfully evades these glob-based filters, excluded resources become accessible to unauthorized users or processes. This can lead to information disclosure if sensitive configuration files containing secrets are exposed. In more complex scenarios involving archive processing or file system operations, it may allow attackers to write to restricted directories or read protected data that was intended to be isolated from public access. The vulnerability is particularly dangerous because it relies on a subtle parsing discrepancy rather than a complete absence of validation, making it difficult to detect through standard static analysis tools that do not account for edge cases involving special whitespace characters in path strings.

To mitigate this risk, developers must upgrade picomatch to version 4.0.8 or later, where the compilation logic has been corrected to properly handle line terminators within globstar patterns. Until an update is applied, alternative mitigation strategies include implementing additional validation layers that explicitly sanitize input by removing or encoding newline characters before passing them to the matching function. It is also advisable to review any custom regex implementations used in conjunction with picomatch to ensure they adhere to strict path normalization standards. From a broader security architecture perspective, this vulnerability aligns with CWE-20 Improper Input Validation and CWE-798 Use of Hard-coded Credentials if sensitive data is exposed due to the bypass. In terms of attack techniques, it corresponds to ATT&CK tactic T1530 Data from Cloud Storage Object Discovery or T1608 Stage Capabilities via compromised resources, as attackers leverage misconfigured filters to access restricted assets. Organizations should audit their dependency trees for picomatch usage and enforce strict input sanitization policies that account for all Unicode whitespace characters, not just standard ASCII spaces.

Responsible

VulnCheck

Reservation

11/28/2026

Disclosure

11/28/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!