nextjs - 💡(How to fix) Fix Bundled picomatch (dist/compiled/picomatch) still on 4.0.3 — flagged HIGH by Trivy (CVE-2026-33671) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#92949Fetched 2026-04-18 05:51:17
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
closed ×1commented ×1labeled ×1locked ×1

Fix Action

Workaround

For now, downstream consumers either:

  1. Add CVE-2026-33671 to .trivyignore (hides a real HIGH for the reachable top-level picomatch too), OR
  2. Use patch-package to post-install overwrite dist/compiled/picomatch/index.js with a shim to the top-level require('picomatch') — fragile, breaks standalone traces.

Neither is ideal — a Next release that re-bundles picomatch 4.0.4 is the right fix.

Code Example

$ npx create-next-app@latest demo
$ cd demo
$ cat node_modules/next/dist/compiled/picomatch/package.json
{"name":"picomatch","main":"index.js",...}
# (version field is stripped, but Trivy identifies it as 4.0.3)

$ trivy fs --scanners vuln .
# → CVE-2026-33671 HIGH on app/node_modules/next/dist/compiled/picomatch/package.json
RAW_BUFFERClick to expand / collapse

Describe the bug

Next.js 16.2.4 (latest) ships with picomatch vendored at node_modules/next/dist/compiled/picomatch/index.js, pinned to 4.0.3.

picomatch 4.0.3 is affected by CVE-2026-33671 (HIGH) — Regular Expression Denial of Service via crafted extglob patterns. Fixed upstream in picomatch 4.0.4.

Since the copy is bundled into Next's tarball, downstream package.json overrides / resolutions cannot reach it. Trivy scans the bundled package.json path and reports the CVE, which is failing security-gated Cloud Build / CI pipelines on apps using Next.js.

Expected behavior

node_modules/next/dist/compiled/picomatch/ reflects picomatch >= 4.0.4 so the CVE no longer shows up in container image scans.

Reproduction

$ npx create-next-app@latest demo
$ cd demo
$ cat node_modules/next/dist/compiled/picomatch/package.json
{"name":"picomatch","main":"index.js",...}
# (version field is stripped, but Trivy identifies it as 4.0.3)

$ trivy fs --scanners vuln .
# → CVE-2026-33671 HIGH on app/node_modules/next/dist/compiled/picomatch/package.json

Workaround

For now, downstream consumers either:

  1. Add CVE-2026-33671 to .trivyignore (hides a real HIGH for the reachable top-level picomatch too), OR
  2. Use patch-package to post-install overwrite dist/compiled/picomatch/index.js with a shim to the top-level require('picomatch') — fragile, breaks standalone traces.

Neither is ideal — a Next release that re-bundles picomatch 4.0.4 is the right fix.

Which area(s) are affected?

Create (next-app)
Runtime (bundled deps)

Which stage(s) are affected?

next build, next start, standalone output

Additional context

extent analysis

TL;DR

The most likely fix for the CVE-2026-33671 vulnerability in Next.js 16.2.4 is to wait for a Next release that re-bundles picomatch 4.0.4.

Guidance

  • Identify the version of picomatch used in your Next.js project by checking node_modules/next/dist/compiled/picomatch/package.json.
  • Consider using a workaround such as adding CVE-2026-33671 to .trivyignore or using patch-package to post-install overwrite dist/compiled/picomatch/index.js with a shim to the top-level require('picomatch').
  • Monitor the Next.js release channel for an update that includes picomatch 4.0.4.
  • Verify the fix by running trivy fs --scanners vuln . after updating Next.js.

Example

No code snippet is provided as the issue is related to a vulnerability in a dependency and not a code-specific problem.

Notes

The provided workarounds have limitations, such as hiding a real HIGH vulnerability or being fragile and breaking standalone traces. A Next release that re-bundles picomatch 4.0.4 is the recommended fix.

Recommendation

Apply a workaround, such as adding CVE-2026-33671 to .trivyignore, until a Next release that includes picomatch 4.0.4 is available, as upgrading to a fixed version is not currently possible.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

node_modules/next/dist/compiled/picomatch/ reflects picomatch >= 4.0.4 so the CVE no longer shows up in container image scans.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix Bundled picomatch (dist/compiled/picomatch) still on 4.0.3 — flagged HIGH by Trivy (CVE-2026-33671) [1 comments, 2 participants]