Daily Tech Briefing
AI 科技速览
每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。
GitHub Blog AI · 2026/7/28 16:00:00
Disrupting supply chain attacks on npm and GitHub Actions
AI 中文解读
GitHub和npm联手推出新安全机制,从源头切断软件供应链攻击链条。
所谓供应链攻击,就像坏人偷偷混进快递包裹分发中心,把一个包裹换成炸弹,然后顺着物流链条炸遍全网。在开源软件世界,攻击者常通过钓鱼邮件骗取维护者账号,或利用CI/CD流水线漏洞,将恶意代码注入到上千个项目中。现在GitHub和npm打了一套组合拳:给高影响力账户加装72小时冷静期,一旦修改邮箱或使用恢复码,账号立即进入只读模式,防止被盗后立刻作恶;同时改变了代码拉取的默认行为,避免从外部分支自动下载不可信代码。这些改动直接掐断了攻击者最常用的渗透路径。
对普通用户来说,这意味着以后下载开源软件或使用相关服务时,遭受恶意代码攻击的风险大大降低。开发者们也不用再时刻警惕“自己的仓库是不是被人植入了后门”,整个软件生态的安全性有了实质性提升。
In the past year, there’s been a pattern of supply chain attacks that target weaknesses in package repositories and CI/CD systems to quickly spread malware to hundreds of open source projects. This malware seeks to exfiltrate credentials both to broadly spread the attack, as well as for later exploitation.
We’ve written a few times about our plans for hardening the supply chain: Our plan for a more secure npm supply chain in September 2025, Strengthening supply chain security: Preparing for the next malware campaign in December 2025, and What’s coming to our GitHub Actions 2026 security roadmap in March 2026. In this post, we’re updating you on changes we’ve implemented that directly disrupt some of the most common and impactful supply chain attack techniques.
Anatomy of supply chain attacks
Supply chain attacks chain together several weaknesses, and there is no single security capability that can stop them. Addressing them takes a holistic approach, prioritizing the mitigations that break the most impactful links in the attack chain. Our teams have been studying these attacks to deploy several improvements that disrupt them and limit their impact. This is possible thanks to collaboration with the security research and developer communities.
The attacks vary in how they spread across the software ecosystem. However, most of these attacks follow similar techniques to gain initial access to a project, escalate privileges, and distribute across users and software. Improvements made to npm and GitHub Actions in the past few months have been focused on cutting off specific, common techniques and providing ways for customers to identify and respond to these attacks.
Initial compromise
Attacks start by compromising a single project, often by directly compromising a maintainer’s account or by targeting the project’s actions workflows.
npm adds preventive account protection for high-impact accounts (June 2026): Frequently, attacks start with a phishing campaign targeting maintainers. With this change, high-impact npm accounts are now put into a read-only mode for 72 hours when they change their email or use a 2FA recovery code. This delay allows maintainers time to respond and recover the account before their account can be used to start an attack.
Safer pull_request_target defaults for GitHub Actions checkout (June 2026): A common vulnerability in a project’s CI/CD pipelines are “pwn requests,” where a workflow triggers on pull requests from forks and then executes user-submitted and untrusted code from that fork. We changed the default behavior of actions/checkout to prevent the checkout of untrusted code from forks in commonly exploited triggers unless you explicitly opt-out (after reviewing your risk). This change and its backport to older versions cut off one of the most common vulnerable code patterns leading to code execution in GitHub Actions CI/CD workflows and initial project compromise.
Control who and what triggers GitHub Actions workflows (June 2026): Maybe you’d prefer to opt-out of these risky action triggers altogether or limit who can trigger them. This new control lets you set enterprise, organization, or repository level policies on who is allowed to trigger workflows and what trigger types are allowed. These workflow execution policies provide a governable and customizable layer of least-privilege around Action workflows that reduce the attack surface of your CI/CD infrastructure.
Read-only Actions cache for untrusted triggers (June 2026): After an attacker has achieved code execution in an Actions workflow, they then look to escalate to more privileged workflows (and therefore credentials) through poisoning the cache entries shared across workflows. With this change, we restrict the ability for less trusted workflows to modify the cache shared with other workflows. This directly closes a common path attackers have used
分享
阅读原文 ↗