AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Next.Js 16.2.4 Bundles Picomatch 4.0.3 Vulnerable To CVE-2026-33671 ReDoS

Next.js 16.2.4 ships an internal copy of picomatch at dist/compiled/picomatch/index.js that is identified by scanners as 4.0.3. picomatch 4.0.3 is affected by CVE-2026-33671, a ReDoS vulnerability via crafted extglob patterns. Top-level npm overrides do not patch the bundled copy, causing security-gated CI pipelines to fail.

highConfidence 93%Next.jsRoute HandlersPages RouterServer ActionsAffected V16.2.4

Origin Analysis

Next.js vendored picomatch version 4.0.3 inside its compiled output. The release tarball contains a bundled dist/compiled/picomatch/index.js that does not respect user package.json overrides. The bundled file retains the vulnerable signature of 4.0.3, while the fix is included in picomatch 4.0.4.
1. git clone https://github.com/BeLazy167/next-picomatch-cve-repro && cd next-picomatch-cve-repro 2. npm install 3. cat node_modules/next/dist/compiled/picomatch/package.json (version field stripped, but Trivy identifies 4.0.3) 4. docker build -t repro . && trivy image repro Observe: picomatch (package.json) | CVE-2026-33671 | HIGH | fixed | 4.0.3 | 4.0.4

Fixing Code Block

Edge Case Audit

This workaround modifies node_modules directly and will be overwritten on a fresh npm install unless the script is added to the postinstall lifecycle. It may break if Next.js changes the internal structure of the compiled picomatch directory. The script requires network access at install time. Rollback: remove the replaced index.js and restore the .bak file, or reinstall Next.js. Only verified against Next.js 16.2.4; newer versions may have the official fix.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state