GitHub Blog

阻断针对npm和GitHub Actions的供应链攻击

GitHub和npm实施了多项安全增强措施以破坏供应链攻击,包括:对高影响力npm账户设置只读模式、改进actions/checkout默认行为防止pwn请求、工作流执行策略、只读Actions缓存、支持CircleCI的信任发布、npm的分阶段发布、npm v12默认禁用安装脚本、Dependabot版本更新冷却期以及自助凭证撤销工具。这些措施针对常见的攻击技术,如通过钓鱼或pwn请求的初始入侵、凭证窃取和快速恶意软件传播。这些变化基于之前的安全路线图,旨在保护开源生态系统。

状态已摘要
抓取快照1
AI 输出2
开放问题0

已验证摘要

英文摘要

Disrupting supply chain attacks on npm and GitHub Actions

GitHub and npm have implemented multiple security enhancements to disrupt supply chain attacks, including read-only mode for high-impact npm accounts, safer default actions/checkout behavior, workflow execution policies, read-only Actions cache, support for trusted publishing on CircleCI, staged publishing for npm, disabling install scripts by default in npm v12, Dependabot version update cooldown, and self-service credential revocation tools. These measures target common attack techniques such as initial compromise via phishing or pwn requests, credential exfiltration, and rapid malware propagation. The changes build on earlier security roadmaps and aim to protect the open source ecosystem.

  • High-impact npm accounts enter 72-hour read-only mode on email change or 2FA recovery to prevent account takeover.
  • actions/checkout default changed to block untrusted code checkout from forks in pull_request_target triggers.
  • New workflow execution policies allow restricting who can trigger workflows and what triggers are allowed.
  • Read-only Actions cache for untrusted workflows prevents cache poisoning privilege escalation.
  • npm now supports trusted publishing with CircleCI to eliminate long-lived credentials.
  • Staged publishing for npm requires additional approval and 2FA for new package versions.
  • npm v12 will disable install scripts by default and block git/remote URL dependencies.

中文摘要

阻断针对npm和GitHub Actions的供应链攻击

GitHub和npm实施了多项安全增强措施以破坏供应链攻击,包括:对高影响力npm账户设置只读模式、改进actions/checkout默认行为防止pwn请求、工作流执行策略、只读Actions缓存、支持CircleCI的信任发布、npm的分阶段发布、npm v12默认禁用安装脚本、Dependabot版本更新冷却期以及自助凭证撤销工具。这些措施针对常见的攻击技术,如通过钓鱼或pwn请求的初始入侵、凭证窃取和快速恶意软件传播。这些变化基于之前的安全路线图,旨在保护开源生态系统。

  • 高影响力npm账户在更改邮箱或使用2FA恢复码时进入72小时只读模式,防止账户被盗。
  • actions/checkout默认改为阻止从fork检出不可信代码,用于pull_request_target触发器。
  • 新的工作流执行策略可限制谁可以触发工作流以及允许的触发器类型。
  • 对不可信工作流设置只读Actions缓存,防止缓存中毒提权。
  • npm现在支持通过CircleCI进行信任发布,消除长期凭证。
  • npm分阶段发布要求新版本包获得额外批准和2FA验证。
  • npm v12将默认禁用安装脚本,并阻止通过git或远程URL添加依赖。

npm / GitHub Actions / supply chain security / CI/CD / malware / credentials / pwn requests / trusted publishing / Dependabot / security enhancements / open source / vulnerability

完整文章

Greg Ose & Zachary Steindler

July 28, 2026|

7 minutes

Share: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 attacksSupply 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 compromiseAttacks 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 to turn a vulnerability with limited impact into one that compromises highly privileged credentials used by release and publishing workflows.Exfiltrate credentialsOnce an attacker has access to a single package, they then focus on detecting and exfiltrating credentials to gain further access and use in later exploitation across ecosystems.npm trusted publishing now supports CircleCI (April 2026) : The number one thing you can do to disrupt these attacks is to remove long-lived credentials from your CI/CD pipeline. Trusted publishing is a great way to authorize publishes to your package repository without a long-lived credential. By adding CircleCI as a trusted publishing provider, we’ve made it possible for more people to remove the credentials these attacks attempt to exfiltrate.Actions network firewall (In technical preview) : This technical preview logs all outbound network traffic from your Action workflow runs so you can detect unusual behavior like pulling down malicious code or exfiltrating credentials to a new domain. Future work will enable network egress restrictions and policies to block these attacks before they lead to further escalation and exfiltration.Propagating the attackWith the credentials harvested from the previous step, attackers attempt to use those credentials to distribute their malware and compromise more projects and maintainers as quickly as possible.Staged publishing for npm (May 2026) : With staged publishing, it’s not enough to have credentials to publish a new package on npm; those packages are staged until additional approval and 2FA authentication is provided in the npm cli or on npmjs.com. This opt-in security control allows maintainers to ensure that any version of their package published has gone through this additional authorization. By decoupling the credentials used in CI/CD pipelines and automation from those that can publish to the registry, the attack chain from a CI/CD pipeline to malware distribution is cut off.Upcoming breaking changes for npm v12 (June 2026) : To spread their malware as quickly as possible, attackers use npm install-time scripts to exfiltrate credentials instead of waiting for code to be executed by the package at runtime. With npm v12, we are rolling out a breaking change that disables these install scripts by default. Since install scripts have legitimate use within the package installation processes that several popular packages rely on, you can reenable them by approving specific scripts. Additional vectors for install-time code execution have also been blocked by disabling dependencies via git or remote URLs by default.Dependabot version updates introduce default package cooldown (July 2026) : Attackers rely on speed, hoping a malicious release gets pulled into as many downstream projects as possible before anyone notices. Version updates through Dependabot now wait until a release has been available for at least three days before opening a pull request, giving detection signals time to surface before a malicious release reaches your project. This cooldown is on by default, and security updates still open immediately, so critical fixes are never delayed.Identifying and responding to supply chain attacksIn parallel to hardening npm and GitHub Actions to disrupt and limit the impact of supply chain attacks, we have also been working on making features and tools available to users to identify and respond to supply chain incidents that have impacted their projects and accounts.Self-service credential revocation for incident response (June 2026) : GitHub credentials remain an ongoing target of attackers in supply chain attacks. This feature provides self-service tooling to instantly revoke all credentials for a given user in an enterprise. This builds on the enterprise-wide credential management tools for incident response released in February and allows enterprise admins and members to quickly respond if credentials have been compromised in a supply chain attack.Expanded credential revocation API support (March 2026) : Recent attacks have included exfiltrating credentials within publicly accessible content. To help the community respond to these attacks, we have expanded support of our credential revocation API ( first introduced in April 2025 for personal access tokens ) to support the revocation of GitHub OAuth and App tokens. This allows the quick and self-service revocation of these leaked credentials, regardless of where they are found, and limits the lifetime during which they can be abused.What’s Next?Making our products more secure by default is a priority across npm and GitHub and we are prioritizing this work to target and disrupt supply chain attacks across the open source ecosystem. We’re proud of the work we’ve shipped towards this goal over the past months. There’s more to come, but we wanted to provide an update on the progress we’ve made and make folks aware of the new capabilities available to them. Be sure to follow our changelog and blog posts as we continue to roll out improvements.Open source software is an incredible public good that we all benefit from, and this is one of several ways GitHub is working to continue to support the security, sustainability, and continued success of open source communities and the enterprises that depend on them.Tags:

GitHub Actions

npm

Security

supply chain securityWritten byPrincipal Product Security EngineerPrincipal Software Engineer, GitHubRelated postsSecurity

The case for a cooldown: Why Dependabot now waits before issuing version updatesA new default three-day cooldown delays version update pull requests so maintainers and security researchers can address findings in a release before it gets into your code.Security

Next chapter: Restructuring GitHub’s bug bounty programGitHub is making some significant changes to its bug bounty program, shifting its focus to give researchers a better experience working with the GitHub team.Application security

How GitHub gave every repository a durable ownerGitHub had over 14,000 repositories. Fewer than half had clear ownership. Here’s how we gave every active repository a validated owner in under 45 days, archived the rest, and made ownership the foundation for everything that followed.We do newsletters, tooDiscover tips, technical guides, and best practices in our biweekly newsletter just for devs.Your email address

抓取快照

用于解析和审计的抓取证据。

200 · text/html; charset=UTF-8

2026/07/29 08:00

a687e28c3fd5c53ee0b459532fdba8570bc6ff164384124d470d58415083ce26

AI 输出

带验证状态的结构化模型输出。

article.summarize

deepseek-v4-flash · 有效

{"tags":["npm","GitHub Actions","supply chain security","CI/CD","malware","credentials","pwn requests","trusted publishing","Dependabot","security enhancements","open source","vulnerability"],"titleEn":"Disrupting supply chain attacks on npm and GitHub Actions","titleZh":"阻断针对npm...
article.classify

deepseek-v4-flash · 有效

{"relevant":true,"confidence":0.95,"primaryTopic":"product-updates","secondaryTopics":["software-engineering"]}

质量问题与日报引用

开放或已解决的问题,以及文章出现在每日日报中的记录。

日报

Signal Hub 2026-07-29

详细介绍了GitHub和npm针对常见供应链攻击途径的全面安全改进,对保护开源生态系统至关重要。 (score: 0.90)

排序 22026/07/29 00:00草稿