Skip to content

Remove the vendored picomatch builds (advisory GHSA-fc5q-39xc-vjpf withdrawn) #3728

Closed

Description

@integry

Problem

The vendored picomatch builds (vendor/picomatch-4.0.8-extglobguard.2.tgz and vendor/picomatch-4.0.8-v2.3.2-extglobguard.2.tgz, issue #3680 item 11) guard extglobs but not a plain group followed by +. Measured on current main (e7fe63c) with the 4.0.8-extglobguard.2 build, matching the 27-character string aaaaaaaaaaaaaaaaaaaaaaaaaab:

pattern result time
(*a)+ false 3353 ms
(*)+x false 19819 ms
(*)+, @(*)+, (a*)+ true 0–1 ms

The time grows exponentially with the string length, so one such glob blocks the Node event loop. Upstream's latest release is still 4.0.7 (2026-08-24) and has the same behaviour.

Expected

  • Both vendored builds reject or safely handle a quantified group whose body can match the same text in more than one way ((*a)+, (*)+x, (a*)+b, (*)*x, nested forms such as ((*)+)+, and the brace/extglob spellings that compile to the same regular expression). Follow the approach of the existing extglob guard in these builds: either compile to an equivalent non-backtracking form or throw the same kind of error the guard already throws, whichever the existing guard does.
  • Patterns that do not have the problem keep their current results. Run the vendored builds' own upstream test suites and this repository's test/vendoredPicomatch.test.mjs.
  • Every such pattern above returns in under 50 ms on a 5,000-character non-matching string.
  • Because the tarball contents change, bump the version suffix (extglobguard.3) in the tarball names, package.json overrides and the lockfile, so an existing node_modules is refreshed by npm install (the rule from Vendored picomatch version suffix and a /tmp-dependent test #3692).
  • List in the PR which call sites in ProPR pass a glob that a user, a repository file or an agent can control to picomatch (directly or through a dependency), so the exposure is known.

Acceptance

  • New cases in test/vendoredPicomatch.test.mjs for each pattern above against both builds, with a time bound.
  • npm ci and the full unit suite pass.

Implementation

Read how the two tarballs were produced (the notes next to vendor/ and test/vendoredPicomatch.test.mjs, and the history of #3692) and reproduce that process; do not hand-edit an unpacked node_modules. Apply the same source change to the 4.x and the 2.3.2-based build. Regenerate package-lock.json with npm install after renaming the tarballs and confirm with npm ci in a clean checkout.

Activity

  1. propr-dev commented on Nov 19, 2026

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 3728/claude-opus-5-5-vendored-picomatch-a-grou-20261119-0956-nkh
    • Base Branch: 3725-epic-0-9-0ws
    • Worktree: issue-3728-20261119-0956-claude-opus-5-5-nkh

    🔍 Track Task Execution

  2. changed the title [-]Vendored picomatch: a group followed by `+` still takes seconds on a 27-character string[/-] [+]Remove the vendored picomatch builds (advisory GHSA-fc5q-39xc-vjpf withdrawn)[/+] on Nov 19, 2026
  3. added a commit that references this issue on Nov 19, 2026
    4cea928
  4. added a commit that references this issue on Nov 19, 2026
    a54764a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions