메뉴
HN
Hacker News 4시간 전

NPM 및 깃허브 액션스 공급망 공격 차단

IMP
8/10
핵심 요약

최근 오픈소스 패키지 저장소와 CI/CD 시스템의 취약점을 노려 악성코드를 빠르게 확산시키는 공급망 공격이 급증함에 따라, 깃허브가 NPM과 깃허브 액션스(GitHub Actions)에 대한 강력한 보안 조치를 도입했습니다. 주요 개선 사항으로는 고위험 계정에 대한 72시간 읽기 전용 모드 적용, '포크(fork) 요청'으로 인한 코드 실행 취약점(Pwn Requests) 방지, 그리고 워크플로우 실행 권한 및 캐시 제어 기능이 포함되어 있어 공격의 핵심적인 경로를 근본적으로 차단하는 것이 특징입니다.

번역된 본문

지난 1년 동안 패키지 저장소와 CI/CD 시스템의 취약점을 표적으로 삼아 수백 개의 오픈소스 프로젝트에 악성코드를 빠르게 확산시키는 공급망 공격 패턴이 발생했습니다. 이러한 악성코드는 공격을 광범위하게 퍼뜨리고 추후 악용하기 위해 자격 증명(credentials)을 유출하려고 시도합니다. 우리는 공급망을 강화하기 위한 계획에 대해 몇 차례 작성한 바 있습니다. 2025년 9월의 더 안전한 npm 공급망을 위한 계획, 2025년 12월의 공급망 보안 강화: 다음 악성코드 캠페인에 대비하기, 그리고 2026년 3월의 깃허브 액션스 2026 보안 로드맵에 포함될 내용입니다. 이 게시물에서는 가장 흔하고 파급력이 큰 공급망 공격 기술을 직접적으로 방해하기 위해 구현한 변경 사항에 대해 최신 정보를 제공하고자 합니다.

공급망 공격의 구조 공급망 공격은 여러 취약점을 연쇄적으로 결합하므로, 이를 막을 수 있는 단일한 보안 기능은 없습니다. 이를 해결하기 위해서는 공격 체인에서 가장 파급력이 큰 연결 고리를 끊는 완화 조치에 우선순위를 두는 총체적인 접근 방식이 필요합니다. 우리의 팀은 이러한 공격을 방해하고 영향을 제한하기 위해 몇 가지 개선 사항을 배포하기 위해 공격을 연구해 왔습니다. 이는 보안 연구원 및 개발자 커뮤니티와의 협업 덕분에 가능했습니다.

공격이 소프트웨어 생태계에 걸쳐 확산되는 방식은 다양합니다. 그러나 이러한 공격의 대부분은 프로젝트에 대한 초기 접근 권한을 얻고, 권한을 상승시킨 다음, 사용자와 소프트웨어 전체에 걸쳐 분배하기 위해 유사한 기술을 따릅니다. 지난 몇 달 동안 npm 및 깃허브 액션스에 적용된 개선 사항은 구체적이고 일반적인 기술을 차단하고 고객이 이러한 공격을 식별하고 대응할 수 있는 방법을 제공하는 데 중점을 두었습니다.

최초의 침해 공격은 종종 관리자 계정을 직접 손상시키거나 프로젝트의 액션스 워크플로우를 표적으로 삼아 단일 프로젝트를 침해하는 것으로 시작됩니다.

  • npm, 고위험 계정에 대한 예방적 계정 보호 추가 (2026년 6월): 종종 공격은 관리자를 표적으로 하는 피싱 캠페인으로 시작됩니다. 이번 변경으로 고위험 npm 계정은 이메일을 변경하거나 2FA 복구 코드를 사용할 때 72시간 동안 읽기 전용 모드로 전환됩니다. 이 지연 시간을 통해 관리자는 계정이 공격을 시작하는 데 사용되기 전에 대응하고 복구할 시간을 가질 수 있습니다.

  • 깃허브 액션스 체크아웃(checkout)을 위한 더 안전한 pull_request_target 기본값 (2026년 6월): 프로젝트의 CI/CD 파이프라인에서 흔히 발생하는 취약점은 '포크된 리포지토리(fork)의 풀 리퀘스트'에서 워크플로우가 트리거되고, 해당 포크에서 사용자가 제출한 신뢰할 수 없는 코드가 실행되는 이른바 'Pwn 요청(pwn requests)'입니다. 우리는 자발적으로 옵트아웃(위험 검토 후)하지 않는 한, 자주 악용되는 트리거에서 포크의 신뢰할 수 없는 코드가 체크아웃되는 것을 방지하기 위해 actions/checkout의 기본 동작을 변경했습니다. 이 변경 사항과 이전 버전에 대한 백포트는 깃허브 액션스 CI/CD 워크플로우에서 코드 실행 및 최초 프로젝트 침해로 이어지는 가장 흔한 취약한 코드 패턴 중 하나를 차단했습니다.

  • 깃허브 액션스 워크플로우를 트리거하는 대상 및 조건 제어 (2026년 6월): 아마도 이러한 위험한 액션 트리거를 완전히 옵트아웃하거나 트리거할 수 있는 사용자를 제한하고 싶을 것입니다. 이 새로운 제어 기능을 통해 워크플로우를 트리거할 수 있는 사용자와 허용되는 트리거 유형에 대한 엔터프라이즈, 조직 또는 리포지토리 수준의 정책을 설정할 수 있습니다. 이러한 워크플로우 실행 정책은 CI/CD 인프라의 공격 표면을 줄이는 거버넌스 가능하고 사용자 정의가 가능한 최소 권한 레이어를 액션 워크플로우 주변에 제공합니다.

  • 신뢰할 수 없는 트리거에 대한 읽기 전용 액션스 캐시 (2026년 6월): 공격자가 액션스 워크플로우에서 코드 실행에 성공한 후, 워크플로우 간에 공유되는 캐시 항목을 훼손하여 더 많은 권한을 가진 워크플로우(및 자격 증명)로 권한 상승을 시도합니다. 이번 변경으로 신뢰도가 낮은 워크플로우가 다른 워크플로우와 공유되는 캐시를 수정하는 기능을 제한했습니다. 이것은 (이러한 공격 경로를) 직접적으로 차단합니다.

원문 보기
원문 보기 (영어)
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 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 to turn a vulnerability with limited impact into one that compromises highly privileged credentials used by release and publishing workflows. Exfiltrate credentials Once 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 attack With 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 attacks In 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