Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

picomatch

Latest version: v4.0.7

Overview

Last scanned
24 Aug 2026
Published
24 Aug 2026
npm package Publisher: danez, doowb, jonschlinkert, mrmlnc
1,287 Stars
129 Forks
1 Versions
3.1B Downloads
JavaScript Repo language

Scan summary

picomatch was last scanned on 24 Aug 2026 at version 4.0.7. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: First and only release on 24 Aug 2026.
  • Findings: No rules fired in version 4.0.7.
  • Downloads: 3,101,602,691 downloads.

Versions

1 version published
Versions and the rules that fired in each
VersionPublishedStatus
4.0.7 LATEST 24 Aug 2026 No rules fired

No rules fired in 4.0.7

Findings

Findings for v4.0.7. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 4.0.7; other versions have their own rules, not their own score.

Known vulnerabilities

2 CVEs · last 26 Mar 2026

0 CRITICAL 1 HIGH 1 MEDIUM 0 LOW

Versions

  • ≥ 4.0.4
  • ≥ 4.0.0, < 4.0.4 1 HIGH 1 MEDIUM
  • ≥ 3.0.2, < 4.0.0
  • ≥ 3.0.0, < 3.0.2 1 HIGH 1 MEDIUM
  • ≥ 2.3.2, < 3.0.0
  • < 2.3.2 1 HIGH 1 MEDIUM

Vulnerabilities

  • CVE-2026-33672 Medium 26 Mar 2026 picomatch: Picomatch: Data integrity compromised via method injection with crafted POSIX bracket expressions Fixed in 4.0.4, 3.0.2, 2.3.2
  • CVE-2026-33671 High 26 Mar 2026 picomatch: Picomatch: Regular Expression Denial of Service via crafted extglob patterns Fixed in 4.0.4, 3.0.2, 2.3.2

Seal Security (npm)

Seal Security ships a patched build of this package. Its fixed versions:

  • CVE-2026-138148: 2.2.2-sp999, 2.3.1-sp999, 2.3.2-sp999, 4.0.1-sp999, 4.0.2-sp2, 4.0.3-sp999, 4.0.4-sp999, 4.0.5-sp999

README

The publisher’s own README, as collected from the registry.

Why picomatch?

  • Lightweight - No dependencies
  • Minimal - Tiny API surface. Main export is a function that takes a glob pattern and returns a matcher function.
  • Fast - Loads in about 2ms (that's several times faster than a single frame of a HD movie at 60fps)
  • Performant - Use the returned matcher function to speed up repeat matching (like when watching files)
  • Accurate matching - Using wildcards (* and ?), globstars (**) for nested directories, advanced globbing with extglobs, braces, and POSIX brackets, and support for escaping special characters with \ or quotes.
  • Well tested - Thousands of unit tests

See the library comparison to other libraries.

Table of Contents

  • Install
  • Usage
  • API
    • picomatch
    • .test
    • .matchBase
    • .isMatch
    • .parse
    • .scan
    • .compileRe
    • .makeRe
    • .toRegex
  • Options
    • Picomatch options
    • Scan Options
    • Options Examples
  • Globbing features
    • Basic globbing
    • Advanced globbing
    • Braces
    • Matching special characters as literals
  • Library Comparisons
  • Benchmarks
  • Philosophies
  • About
    • Author
    • License

(TOC generated by verb using markdown-toc)

Install

Install with npm:

npm install --save picomatch

Usage

The main export is a function that takes a glob pattern and an options object and returns a function for matching strings.

const pm = require('picomatch');
const isMatch = pm('*.js');

console.log(isMatch('abcd')); //=> false
console.log(isMatch('a.js')); //=> true
console.log(isMatch('a.md')); //=> false
console.log(isMatch('a/b.js')); //=> false

API

picomatch

Creates a matcher function from one or more glob patterns. The returned function takes a string to match as its first argument, and returns true if the string is a match. The returned matcher function also takes a boolean as the second argument that, when true, returns an object with additional information.

Params

  • globs {String|Array}: One or more glob patterns.
  • options {Object=}
  • returns {Function=}: Returns a matcher function.

Example

const picomatch = require('picomatch');
// picomatch(glob[, options]);

const isMatch = picomatch('*.!(*a)');
console.log(isMatch('a.a')); //=> false
console.log(isMatch('a.b')); //=> true

// For environments without `node.js`, `picomatch/posix` provides you a dependency-free matcher, without automatic OS detection.
const picomatch = require('picomatch/posix');
// the same API, defaulting to posix paths
const isMatch = picomatch('a/*');
console.log(isMatch('a\\b')); //=> false
console.log(isMatch('a/b')); //=> true

// you can still configure the matcher function to accept windows paths
const isMatch = picomatch('a/*', { options: windows });
console.log(isMatch('a\\b')); //=> true
console.log(isMatch('a/b')); //=> true
.test

Test input with the given regex. This is used by the main picomatch() function to test the input string.

Params

  • input {String}: String to test.
  • regex {RegExp}
  • returns {Object}: Returns an object with matching info.

Example

const picomatch = require('picomatch');
// picomatch.test(input, regex[, options]);

console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
// { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
.matchBase

Match the basename of a filepath.

Params

  • input {String}: String to test.
  • glob {RegExp|String}: Glob pattern or regex created by .makeRe.
  • returns {Boolean}

Example

const picomatch = require('picomatch');
// picomatch.matchBase(input, glob[, options]);
console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
.isMatch

Returns true if any of the given glob patterns match the specified string.

Params

  • {String|Array}: str The string to test.
  • {String|Array}: patterns One or more glob patterns to use for matching.
  • {Object}: See available options.
  • returns {Boolean}: Returns true if any patterns match str

Example

const picomatch = require('picomatch');
// picomatch.isMatch(string, patterns[, options]);

console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
.parse

Parse a glob pattern to create the source string for a regular expression.

Params

  • pattern {String}
  • options {Object}
  • returns {Object}: Returns an object with useful properties and output to be used as a regex source string.

Example

const picomatch = require('picomatch');
const result = picomatch.parse(pattern[, options]);
.scan

Scan a glob pattern to separate the pattern into segments.

Params

  • input {String}: Glob pattern to scan.
  • options {Object}
  • returns {Object}: Returns an object with

Example

const picomatch = require('picomatch');
// picomatch.scan(input[, options]);

const result = picomatch.scan('!./foo/*.js');
console.log(result);
{ prefix: '!./',
  input: '!./foo/*.js',
  start: 3,
  base: 'foo',
  glob: '*.js',
  isBrace: false,
  isBracket: false,
  isGlob: true,
  isExtglob: false,
  isGlobstar: false,
  negated: true }
.compileRe

Compile a regular expression from the state object returned by the parse() method.

Params

  • state {Object}
  • options {Object}
  • returnOutput {Boolean}: Intended for implementors, this argument allows you to return the raw output from the parser.
  • returnState {Boolean}: Adds the state to a state property on the returned regex. Useful for implementors and debugging.
  • returns {RegExp}

Example

const picomatch = require('picomatch');
const state = picomatch.parse('*.js');
// picomatch.compileRe(state[, options]);

console.log(picomatch.compileRe(state));
//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
.makeRe

Create a regular expression from a parsed glob pattern.

Params

  • state {String}: The object returned from the .parse method.
  • options {Object}
  • returnOutput {Boolean}: Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.
  • returnState {Boolean}: Implementors may use this argument to return the state from the parsed glob with the returned regular expression.
  • returns {RegExp}: Returns a regex created from the given pattern.

Example

const picomatch = require('picomatch');
// picomatch.makeRe(state[, options]);

const result = picomatch.makeRe('*.js');
console.log(result);
//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
.toRegex

Create a regular expression from the given regex source string.

Params

  • source {String}: Regular expression source string.
  • options {Object}
  • returns {RegExp}

Example

const picomatch = require('picomatch');
// picomatch.toRegex(source[, options]);

const { output } = picomatch.parse('*.js');
console.log(picomatch.toRegex(output));
//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/

Options

Picomatch options

The following options may be used with the main picomatch() function or any of the methods on the picomatch API.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm picomatch

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Frame 2085668439 (1)
Group 1261154229