CVE Professor
/
All CVEs
CVE-2026-138148

CVE-2026-138148 — Micromatch Picomatch — CWE-185

MEDIUM CVSS 5.3 ⚡ EPSS 0.4% NVD

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.

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.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality Low C:L
Integrity None I:N
Availability None A:N
EPSS — Exploit Prediction Scoring System
0.4%
30-day probability
In the 26. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

🎯 What is this vulnerability?

CVE‑2026‑138148 is a glob filter bypass in the JavaScript library picomatch (v4.0.7 and earlier).
Picomatch is a fast, POSIX‑compliant glob matcher used by many Node.js tools (e.g., npm, Yarn, ESLint, Jest, etc.). The vulnerability arises from the way the library compiles glob patterns that contain the globstar ()** operator.

Technical flaw

  • CWE‑185 – Incorrectly Handling of Input
  • The library compiles glob patterns into regular expressions. For patterns that contain , the generated regex omits the dotAll (s) flag**. Without dotAll, the . meta‑character does not match line‑terminator characters (\n, \r). Consequently, a pattern such as */.js will not match file names that contain newline characters, because the newline breaks the match.
  • Resulting behavior
  • When an application uses picomatch to filter out files (e.g., “do not process files that match */.tmp”), an attacker can craft a file name that includes a newline. The glob filter will treat the part after the newline as a separate string, bypassing the deny pattern and allowing the file to be processed or exposed.
  • CVSS vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N * No authentication or privilege is required. * The impact is low confidentiality (exposed data) but no integrity or availability impact.

    ⚡ Attack Chain

    NOTE: The following chain is a generic illustration of how the vulnerability can be abused in a Node.js application that uses picomatch for file filtering. The exact endpoint or parameter names are not specified in the CVE; the example below assumes a typical file‑upload API.

    1. Discovery & Reconnaissance

    StepTechniqueTools / Commands
    Identify the librarySearch package.json or node_modules for picomatchgrep -R "picomatch" -n package.json node_modules/
    Verify versionInspect package.json or npm ls picomatchnpm ls picomatch
    Confirm vulnerabilityCheck if version ≤ 4.0.7npm view picomatch version

    If the target is a public API, a simple curl to the upload endpoint can reveal that the server accepts file uploads and that the response contains the file name (common in many file‑upload services).

    2. Exploitation

    Goal: Upload a file whose name contains a newline character that bypasses a */.tmp deny pattern.

    a. Crafting the payload

    # Create a file with a newline in its name
    printf "evil.txt\n.tmp" > /tmp/evil.txt

    The file name is evil.txt\n.tmp. The part after the newline (.tmp) would normally be matched by a deny pattern, but because picomatch’s regex does not use dotAll, the newline splits the match.

    b. Uploading the file

    Assume the API endpoint is /api/upload and accepts multipart/form-data:

    curl -X POST http://target.example.com/api/upload \
      -F "file=@/tmp/evil.txt" \
      -H "Authorization: Bearer <token>"
    Illustrative – the actual endpoint and authentication method may differ.

    c. Server processing

    1. The server receives the multipart request and extracts the file name evil.txt\n.tmp.
    2. It passes the file name through picomatch with a deny pattern such as */.tmp.
    3. Because the regex lacks dotAll, the pattern matches only up to the newline, not the .tmp suffix.
    4. The file is accepted and stored (or processed) as evil.txt\n.tmp.

    3. Post‑exploitation

  • Data exposure – The attacker can now access the file via the application’s file‑listing or download endpoint.
  • Privilege escalation – If the application processes the file (e.g., executes a script, imports a module), the attacker may gain code execution.
  • Persistence – The attacker can upload additional malicious files that bypass other glob filters.

  • 🌍 Real World Impact

    ImpactAssessment
    ConfidentialityLow – only the data in the uploaded file is exposed.
    IntegrityNone – the vulnerability does not alter existing data.
    AvailabilityNone – no denial‑of‑service effect.

    Practical consequences

  • File‑upload services (e.g., CI/CD pipelines, static site generators) may inadvertently store or serve files that should be excluded.
  • Security‑by‑default configurations that rely on glob patterns to block certain file types (e.g., .tmp, .log) can be subverted.
  • Automated build tools that glob‑include source files may process unintended files, potentially leading to build failures or leakage of sensitive data.

  • 🛡️ Remediation & Mitigation

    1. Patch

    AffectedFixed
    picomatch 4.0.7 and earlier4.0.8 (released 2026‑11‑25) – regexes for ** patterns now use the dotAll flag.

    Action:

    npm install picomatch@^4.0.8

    or update the dependency in package.json and run npm update.

    2. Workarounds (if patching is not immediately possible)

    MitigationImplementation
    Disable globstarIn the application’s configuration, avoid using in deny patterns. Replace /*.tmp with *.tmp or use a custom filter that explicitly checks for newline characters.
    Pre‑sanitize file namesStrip or encode newline characters before passing the name to picomatch. Example in Node.js: const sanitized = filename.replace(/[\r\n]/g, '_');
    WAF / ModSecurity ruleBlock uploads containing newline characters in the file name. Example ModSecurity rule: <br>SecRule REQUEST_FILENAME "@rx \n" "id:1001,phase:2,deny,msg:'Newline in filename'"

    3. Detection

    IndicatorLog pattern / IoC
    Upload request with newline in filenamePOST /api/upload with filename=".*\n.*"
    File stored with newline in nameFile system audit: ls -lgrep $'\n'
    Application logs mentioning “globstar” or “dotAll”grep -i "globstar" /var/log/app.log

    Example WAF log entry (ModSecurity):

    [modsecurity] [client 192.0.2.10] [id 1001] [msg "Newline in filename"] [uri /api/upload] [status 403]

    4. Monitoring

  • Enable file‑system integrity monitoring (e.g., Tripwire) to detect unexpected files.
  • Set up alerts for HTTP 403 responses from the upload endpoint.

  • ⚠️ Urgency

  • CVSS score: 5.3 (Medium) – low confidentiality impact, but the flaw is easy to exploit.
  • Exploit complexity: Low (no authentication, no privilege escalation required).
  • CISA KEV status: No – not yet a known exploit in the wild.
  • Recommendation: High priority for environments that expose file‑upload or file‑listing functionality, especially those that rely on glob patterns to enforce security policies.
  • Patch timeline: Apply the 4.0.8 update within 7 days of discovery for critical services; within 30 days for non‑critical or internal tools.

[🤖 CVE Professor AI Security Engine]
Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="micromatch picomatch"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-138148
Technical reference / advisory repository for CVE-2026-138148
Technical reference / advisory repository for CVE-2026-138148
Technical reference / advisory repository for CVE-2026-138148
CVSS Score
5.3 / 10 · CVSS MEDIUM
Weakness Types (CWE)
CWE-185
Affected Products (1)
micromatch:picomatch
Related CVEs
8.9
CVE-2026-144591
PhpSpreadsheet through 5.12.0 contains a server-side request forgery vulnerability that allows attackers to re
8.5
CVE-2026-120096
Missing authorization in the push publishing endpoints REST API (/api/v1/environments/endpoints) and in the pu
8.2
CVE-2026-144617
Traccar 6.13.0 before 6.18.0 contains a denial of service vulnerability that allows remote attackers knowing a
8.2
CVE-2026-144623
Micronaut core HTTP client 4.10.24 through 4.10.37 and 5.0.1 through 5.3.0 contains a credential leak vulnerab
8.2
CVE-2026-144684
postcss-selector-parser before 6.1.6 and 7.x before 7.1.8 contains a denial of service vulnerability that allo
8.2
CVE-2026-144963
Docutils before 0.23.1 contains a TeX injection vulnerability in the LaTeX writer that allows attackers supply
7.7
CVE-2026-145367
### Summary In ambient mode, `istiod` does not correctly convert the `trustDomains` and `notTrustDomains` sou