pdfkit npm package ships the Yarn 4.16.0 binary (.yarn/releases) with outdated tar/js-yaml/got/picomatch

已关闭 适合新手
#1,853 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript, nodejs
领域
release

调研方向

发布的 tarball 包含 .yarn/ 和 .yarnrc.yml,但仓库的 .npmignore 并未排除它们。请先阅读 .npmignore,并与 package.json 中的 files 字段进行比较,然后运行 npm pack --dry-run 列出将要发布的内容。完成标准是 dry run 结果中不再列出 .yarn/ 或 .yarnrc.yml,修改方式可以是添加一条忽略规则,也可以是使用白名单。请与维护者确认他们更倾向哪种方式。

由索引模型根据 Issue 内容生成。

描述

Since 0.18.0 the pdfkit tarball includes .yarn/releases/yarn-4.16.0.cjs (plus .yarn/install-state.gz and .yarnrc.yml). .npmignore does not exclude .yarn/. That file is a full Yarn bundle with these inlined libraries:

  • tar 7.5.9: CVE-2026-29786 / CVE-2026-31802 (drive-relative link path traversal), CVE-2026-59871/59873/59874/59875/73566 (parser DoS/crash)
  • js-yaml 3.14.1: CVE-2025-64718 (merge prototype pollution), CVE-2026-53550, CVE-2026-59869, GHSA-5p4m-2wfm-xmqj (quadratic CPU in merge/omap)
  • got 11.8.2: CVE-2022-33987 (redirect to UNIX socket). micromatch 4.0.5: CVE-2024-4067 (ReDoS). picomatch 2.3.1/4.0.3: CVE-2026-33671 (extglob ReDoS)

None of these are declared in pdfkit's package.json, so npm audit and SCA tools cannot flag them for you or for pdfkit users, but they sit in every node_modules/pdfkit. pdfkit never loads the file, so this is about removing files that are published but unused.

Because the copy ships where dependency audits cannot see it, it is easy to miss. We would suggest updating it when convenient, and sooner if untrusted input can reach it in your setup.

Suggested fix: add .yarn/ and .yarnrc.yml to .npmignore (or add a files allowlist) and publish a new version. Bumping Yarn alone does not help, because Yarn 4.18.1 still bundles the same versions.

主要语言
JavaScript
星标
10.7k
派生
1.2k
平均合并
21 小时 41 分钟
30 天内合并 PR
27

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

foliojs/pdfkit 的其他 Issue

查看 foliojs/pdfkit 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。