<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>软件供应链安全 | 锤子前端</title><description>Now vibe coding, so learning hammer FE ?</description><link>https://channel.meo-ai.com</link><item><title>《Bun 生态里的 Dependabot 盲区：Dependabot 告警读不到 bun.lock》</title><link>https://channel.meo-ai.com/posts/740</link><guid isPermaLink="true">https://channel.meo-ai.com/posts/740</guid><pubDate>Wed, 04 Nov 2026 10:48:48 GMT</pubDate><content:encoded>&lt;span class=&quot;post-title-source&quot;&gt;《Bun 生态里的 Dependabot 盲区：Dependabot 告警读不到 bun.lock》&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;标签：&lt;br /&gt;&lt;a href=&quot;/search/result?q=%23%E8%BD%AF%E4%BB%B6%E4%BE%9B%E5%BA%94%E9%93%BE%E5%AE%89%E5%85%A8&quot; title=&quot;#软件供应链安全&quot;&gt;#软件供应链安全&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E4%BE%9D%E8%B5%96%E7%AE%A1%E7%90%86&quot; title=&quot;#依赖管理&quot;&gt;#依赖管理&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23Bun&quot; title=&quot;#Bun&quot;&gt;#Bun&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23Dependabot&quot; title=&quot;#Dependabot&quot;&gt;#Dependabot&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E4%BE%9D%E8%B5%96%E5%9B%BE%E8%B0%B1&quot; title=&quot;#依赖图谱&quot;&gt;#依赖图谱&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E5%BC%80%E6%BA%90%E6%BC%8F%E6%B4%9E%E5%91%8A%E8%AD%A6&quot; title=&quot;#开源漏洞告警&quot;&gt;#开源漏洞告警&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E4%BC%A0%E9%80%92%E4%BE%9D%E8%B5%96&quot; title=&quot;#传递依赖&quot;&gt;#传递依赖&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23CVE%E6%B2%BB%E7%90%86&quot; title=&quot;#CVE治理&quot;&gt;#CVE治理&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E5%89%8D%E7%AB%AF%E5%B7%A5%E7%A8%8B%E5%8C%96&quot; title=&quot;#前端工程化&quot;&gt;#前端工程化&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;总结：&lt;br /&gt;GitHub 的依赖图谱至今还不能解析 &lt;code&gt;bun.lock`，因此在使用 Bun 的项目里，Dependabot 安全告警只能看到 `package.json&lt;/code&gt; 中直接声明的依赖，所有传递依赖以及通过 catalog 声明的依赖都会从它的视野中消失。结果是，迁移到 Bun 之后，项目看起来变得更“干净”了，但这其实是因为大量漏洞都变得看不见了。&lt;br /&gt;&lt;br /&gt;文章要点：&lt;br /&gt;1. 作者发现，自己团队里已改用 Bun 的前端，Dependabot 告警数量少得反常，而且这些告警全都指向直接依赖，一条传递依赖告警都没有；于是开始追查原因，发现是 Bun 生态里的 Dependabot 盲区。&lt;br /&gt;2. 根本原因是依赖图谱的“支持清单”里只有 `package-lock.json`、`yarn.lock`、`pnpm-lock.yaml`，没有 `bun.lock`；遇到 Bun 项目时，它只能退回读取 `package.json`，从而丢失了完整的版本信息。&lt;br /&gt;3. 这里有一个容易让人混淆的地方：Dependabot 的**版本更新**从 2025 年初起就已经支持 Bun，会帮你修改 `bun.lock`；但**安全告警**走的是另一套依赖图谱，至今仍然不读它。&lt;br /&gt;4. 作者构建了一个最小复现案例：`bun audit` 报告了 3 个漏洞（`zod`、`uuid` 以及 &lt;code&gt;happy-dom&lt;/code&gt; 的 CVE-2026-33943），而 GitHub 只对 &lt;code&gt;zod&lt;/code&gt; 发出了告警，因为 &lt;code&gt;uuid&lt;/code&gt; 只存在于 lockfile 中，`happy-dom` 的版本被记录成了字面量字符串 `catalog:`。&lt;br /&gt;5. 在演示项目中，GitHub 只看到 12 个包中的 3 个；而在真实项目里，大部分包都是传递依赖，所以这个缺口比 3/12 所显示的更大。&lt;br /&gt;6. 另一个更隐蔽的坑是：从 npm 或 Yarn 迁移到 Bun 时，旧 lockfile 会消失，GitHub 于是把那些依赖的未解决告警标记为**已修复**；但漏洞仍然原封不动地留在 `bun.lock` 里。&lt;br /&gt;7. 作者提供的解法是 GitHub 的依赖提交 API：他自己写了一个 &lt;code&gt;bun-lock-submission&lt;/code&gt; Action，它能读取仓库里所有 `bun.lock`（包含 workspace 和 catalog），并区分直接依赖与传递依赖、运行时依赖与开发依赖，然后一次性提交；实测几分钟内就会出现告警，通常只需要几秒。&lt;br /&gt;8. 使用前需要了解几点：告警只跟随默认分支；它只提供告警，不提供修复（修复需要依靠 `bun audit fix`）；首次运行会一次性出现一批告警，需要预留时间进行分类处理；私有包要使用 `exclude` 排除，避免因为与公开包重名而出现误报。&lt;br /&gt;9. 作者的落地建议是：先自查是否受影响（查看 Dependency graph 里有没有 &lt;code&gt;bun.lock`，再用 `gh api&lt;/code&gt; 统计告警的来源分布），复查迁移日期前后被关闭的告警，加上这个 Action 并预留时间处理告警，等 GitHub 原生支持之后，再删掉工作流，并运行 `bunx bun-lock-submission clear`。&lt;br /&gt;&lt;br /&gt;URL：&lt;a href=&quot;https://charpeni.com/blog/the-bun-dependabot-gap-dependabot-alerts-dont-see-bun-lock&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;https://charpeni.com/blog/the-bun-dependabot-gap-dependabot-alerts-dont-see-bun-lock&quot;&gt;https://charpeni.com/blog/the-bun-dependabot-gap-dependabot-alerts-dont-see-bun-lock&lt;/a&gt;&lt;a class=&quot;tgme_widget_message_link_preview&quot; href=&quot;https://charpeni.com/blog/the-bun-dependabot-gap-dependabot-alerts-dont-see-bun-lock&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;GitHub&apos;s dependency graph doesn&apos;t read bun.lock yet, so in Bun projects Dependabot alerts only cover what&apos;s written in package.json, and never a transitive dependency. Here&apos;s how to check if you&apos;re affected, and how I closed the gap with a GitHub Action.&quot;&gt;
  
  &lt;div class=&quot;link_preview_site_name accent_color&quot;&gt;Nicolas Charpentier&lt;/div&gt;
  &lt;img class=&quot;link_preview_image&quot; alt=&quot;The Bun Dependabot Gap: Dependabot Alerts Don&apos;t See bun.lock | Nicolas Charpentier&quot; src=&quot;/static/https://cdn4.telesco.pe/file/TBIxBITj_2eu8t6u3yrJW1Nrm0ak_aQyONfDviiIpueZmdnMhx5IgcLZyaTkQQUeVxWfwhOhP79ZlgooSe0Q5DuQZaNGk7d1kEU2LAx_5g40A1ripm7c0zfS551brJQoLltuCHX0Pdksj3U_c2c0Za81K9ES0xYR2guiB6uRavuzL-mV_DTtdWuqYTYQHPr1SPo3KbtIfaiCcxf01zlbGfqF4LbQXbqyHsmAcXbhy8deYuEBSvlGLTjR98w9GG2DoCas0SOuGeHo9IBM4AagLe3-WBDSNU3ca-2sYpf7opFnvYDkweiEUy-1QcwbZ7EM4OcbuhdVvgKReju6mBrAhw.jpg&quot; width=&quot;1200&quot; height=&quot;630&quot; loading=&quot;eager&quot; /&gt;
  &lt;div class=&quot;link_preview_title&quot;&gt;The Bun Dependabot Gap: Dependabot Alerts Don&apos;t See bun.lock | Nicolas Charpentier&lt;/div&gt;
  &lt;div class=&quot;link_preview_description&quot;&gt;GitHub&apos;s dependency graph doesn&apos;t read bun.lock yet, so in Bun projects Dependabot alerts only cover what&apos;s written in package.json, and never a transitive dependency. Here&apos;s how to check if you&apos;re affected, and how I closed the gap with a GitHub Action.&lt;/div&gt;
&lt;/a&gt;</content:encoded></item></channel></rss>