BeLazy167/next-picomatch-cve-repro
GitHub: BeLazy167/next-picomatch-cve-repro
重现 Next.js 捆绑 picomatch 的 CVE-2026-33671 高危漏洞,并验证 overrides 无法覆盖该捆绑副本。
Stars: 0 | Forks: 0
# Next.js 捆绑 picomatch CVE-2026-33671 重现
最小重现步骤:
- Next.js 16.2.4 捆绑了 picomatch 4.0.3,位于 `node_modules/next/dist/compiled/picomatch/`,受 **CVE-2026-33671**(高危)影响。npm 的 `overrides` 无法覆盖到该捆绑副本。
## 步骤
```
npm install
```
### 1. 检查捆绑副本
```
cat node_modules/next/dist/compiled/picomatch/package.json
# → {"name":"picomatch","main":"index.js",...} (version field stripped)
```
### 2. 使用 Trivy 扫描
```
npx next build
docker build -t next-picomatch-repro .
trivy image next-picomatch-repro
```
预期输出:
```
picomatch (package.json) | CVE-2026-33671 | HIGH | fixed | 4.0.3 | 4.0.4
```
### 3. 证明 `overrides` 无效
`package.json` 可以扩展为:
```
"overrides": {
"picomatch": "4.0.4"
}
```
这会正确安装 `node_modules/picomatch@4.0.4`,但 `node_modules/next/dist/compiled/picomatch/` 仍保持 4.0.3,因为它被捆绑在 Next 自身的 tarball 中。
## 预期修复
Next.js 发布一个补丁版本,将 `dist/compiled/picomatch/` 重新捆绑为 picomatch ≥ 4.0.4。下游消费者随后通过正常的 `npm install` 拉取该修复。
标签:AI应用开发, CVE-2026-33671, Docker, GNU通用公共许可证, HIGH, MITM代理, Node.js, npm, picomatch, 代码混淆, 依赖管理, 安全防御评估, 打包, 暗色界面, 最小可复现代码, 活动识别, 漏洞, 补丁版本, 覆盖安装, 覆盖覆盖无效, 请求拦截, 镜像扫描