메뉴
BL
Ars Technica 57일 전

레드햇 공식 NPM 계정 해킹, 30여 개 패키지 백도어 감염

IMP
8/10
핵심 요약

레드햇의 공식 NPM 계정(@redhat-cloud-services)이 해킹되어 공급망 공격이 발생했습니다. 악성코드(Shai-Hulud)는 설치 과정에서 GitHub, npm, Kubernetes 등의 민감한 인증 정보를 탈취하고 다른 시스템으로 전파되는 웜 형태입니다. 이 사건은 CI/CD 파이프라인 보안의 중요성과 공급망 공격의 연쇄적 위험성을 보여줍니다.

번역된 본문

공식 레드햇 NPM 계정이 탈취되어 기계에서 기계로 확산되며 더 많은 기밀 데이터를 훔치기 위해 민감한 자격 증명을 빼내는 악성 웜(worm)을 배포하는 데 악용되었다고 보안 연구원들이 밝혔다.

보안 기업 Aikido의 연구원들에 따르면, 이 공급망 공격은 월요일에 시작되어 이 글이 작성되는 시점까지도 활발하게 진행 중이었다. 이번 해킹은 위협 행위자가 Red Hat 공식 패키지를 위해 예약된 NPM 리포지토리의 정식 채널인 @redhat-cloud-services에 대한 제어권을 확보한 결과이다. 따라서 이 채널은 Red Hat 클라우드 서비스에 의존하는 개발자들에게 널리 신뢰받고 있다.

오늘날 공급망 공격의 악순환

위협 행위자가 어떻게 이 네임스페이스에 대한 제어권을 획득했는지는 명확하지 않지만, 거의 확실하게 이전의 공급망 공격을 통해 접근에 필요한 자격 증명이 유출되었을 가능성이 높다. 30개 이상의 패키지가 영향을 받은 것으로 보인다. 해당 패키지들은 개발자가 프로덕션 환경에서 패키지를 가져오거나 실제로 사용하기 전에 발생하는 'npm install' 프로세스 중에 실행될 수 있는 난독화된 페이로드를 실행한다.

보안 기업 Socket은 이 악성코드에 대한 분석 결과, GitHub Action 비밀값(secrets), npm 토큰, Kubernetes 및 Vault 자료, 기타 클라우드 서비스에 대한 자격 증명을 포함한 민감한 정보를 수집하도록 설계되었다고 밝혔다. 그런 다음 이 웜은 감염된 기기가 접근할 수 있는 타사 계정에 백도어가 심긴 패키지를 다시 게시하여 확산된다.

사건 발생 후 몇 시간 내에 대부분의 패키지가 삭제되었으나 일부는 그러지 않았다. Socket 연구원들은 "기관은 영향을 받은 @redhat-cloud-services 패키지 버전 중 하나를 설치한 모든 시스템을 잠재적으로 손상된 것으로 간주해야 한다"고 경고했다. "페이로드는 애플리케이션 코드가 패키지를 가져오거나 사용하기 전인 npm install 중에 실행되므로 노출 여부는 런타임 사용이 아닌 설치 또는 CI(지속적 통합) 실행에 따라 결정된다."

시스템이 감염되면 자격 증명을 암호화하여 웹 요청을 통해 전송한다. 또한 대체 메커니즘을 통해 자격 증명을 보유하고 있는 경우 악성코드가 암호화된 데이터를 손상된 GitHub 리포지토리에 게시할 수 있다.

Shai-Hulud로 명명된 이 웜은 지난달 무료 오픈 소스로 공개된 악성코드의 모든 특징을 가지고 있다. TeamPCP는 Shai-Hulud를 사용한 최초의 그룹이었으며, 이 악성코드를 사용하여 가장 큰 공급망 공격을 수행한 해커에게 1,000달러의 현금을 지급하겠다는 경연 대회를 개최하기도 했다. TeamPCP는 과거에도 수많은 공급망 공격의 배후에 있었다. 이제 이 웜이 다른 많은 위협 그룹의 손에 들어감에 따라 공급망 공격은 더욱 기승을 부릴 수 있다.

이 악성코드는 코드 변경 사항의 빌드, 테스트 및 배포를 자동화하여 더 빠르고 안정적인 소프트웨어 릴리스를 가능하게 하는 CI/CD(지속적 통합/지속적 배포) 시스템에 상당한 주의를 기울인다. 월요일 공격에서 확산된 악성코드는 GitHub Actions OIDC(OpenID Connect)를 통해 게시되었으며, 이는 Red Hat의 CI/CD 파이프라인이 손상되었음을 나타낸다. OIDC는 임시 자격 증명을 사용하여 클라우드 서비스와 상호 작용하도록 설계된 보안 조치이다.

일단 설치되면 악성코드는 다른 조직의 CI/CD 자격 증명을 표적으로 삼는다. Red Hat의 GitHub Actions OIDC 침해는 직원의 컴퓨터를 감염시킨 이전 공급망 공격의 결과일 가능성이 매우 높다.

보도 후 Red Hat은 이메일을 통해 악성 패키지를 제거했다고 밝혔다. 이메일은 "해당 패키지는 내부 개발로만 엄격히 제한되며, 악성 코드는 console.redhat.com 시스템을 통해 고객이 사용할 수 있도록 게시된 적이 없다"며, "조사가 진행 중이지만 고객 또는 파트너 환경 및 Red Hat 프로덕션 시스템에 미친 영향은 발견되지 않았다"고 전했다.

최근 다른 공급망 공격들의 성공을 고려할 때, 이러한 공격의 표적이 된 누구라도...

원문 보기
원문 보기 (영어)
Text settings Story text Size Small Standard Large Width * Standard Wide Links Standard Orange * Subscribers only Learn more Minimize to nav Official Red Hat NPM accounts have been compromised and used to push a malicious worm that spreads from machine to machine, where it pilfers sensitive credentials in hopes of stealing yet more confidential data, researchers said. The supply-chain attack began Monday and remained active at the time this post went live, according to researchers at security firm Aikido. It’s the result of the threat actor responsible for the hack taking control of @redhat-cloud-services, a legitimate channel in the npm repository that’s reserved for official Red Hat packages. As such, the channel is widely trusted by developers who rely on Red Hat cloud services. The vicious cycle of today’s supply-chain attacks It’s unclear precisely how the threat actor took control of the namespace, but it almost certainly involved the compromise of credentials required to access it, possibly through a previous supply-chain attack. More than 30 packages seem to be affected. The packages execute an obfuscated payload that can run during the npm install process, which occurs before a developer imports or actually uses the package in a production environment. Security firm Socket said an analysis of the malware revealed that it’s designed to collect sensitive credentials, including GitHub action secrets, npm tokens, Kubernetes and Vault material, and credentials for other cloud services. The worm then spreads by republishing backdoored packages to third-party accounts the infected device has access to. Most, but not all, of the packages had been taken down in the hours following the incident. “Organizations should treat any system that installed one of the affected @redhat-cloud-services package versions as potentially compromised,” Socket researchers wrote. “The payload executes during npm install, before application code imports or uses the package, so exposure depends on installation or CI execution, not runtime use.” Once a system is infected, it encrypts the credentials and sends them through a web request. A fallback mechanism allows the malware to publish the encrypted data into a compromised GitHub repository, assuming it has possession of the credentials for it. The worm, dubbed Shai-Hulud, has all the hallmarks of malware released last month as freely available open source. TeamPCP was the first group to use Shai-Hulud, and it promoted a competition that promised a $1,000 payment to the hacker who carried out the biggest supply-chain attack using the malware. TeamPCP has also been behind a rash of previous supply-chain attacks . Now that the worm is in the hands of many other threat groups, supply-chain attacks may ramp up further. The malware devotes considerable attention to CI/CD (continuous integration/continuous delivery) systems, which allow for faster and more reliable software releases by automating the building, testing, and deploying of code changes. The malware spread in Monday’s attack was published through GitHub Actions OIDC (OpenID Connect), indicating that Red Hat’s CI/CD pipeline was compromised. OIDC is a security measure designed to interact with cloud services through the use of temporary credentials. Once installed, the malware targets other organizations’ CI/CD credentials. The compromise of Red Hat’s GitHub Actions OIDC was very possibly the result of a previous supply-chain attack that infected an employee’s machine. In an email sent after this post went live, Red Hat said it has removed the malicious packages. “The packages are strictly limited to internal development, and the malicious code was never published for customer consumption via the console.redhat.com system,” the email said. “While our investigation is ongoing, we have not identified any impact to customer or partner environments or Red Hat production systems.” Given the success of other recent supply-chain attacks, anyone who touched one of the affected packages in the past 36 hours should assume compromise of their workstations, CI/CD pipelines, and all credentials for cloud services and repositories. That means employees should drop whatever they’re doing at the moment and investigate thoroughly. In a recent supply-chain attack that hit Checkmarx, the security firm failed to fully drive out the party responsible. Checkmarx was then hit two more times. The Checkmarx credentials used in the first attack came from a supply chain attack on the Trivy software developer. The pivot to Checkmarx and its failure to fully remediate the initial breach demonstrates the difficulty of completely recovering from such security lapses and the risks that result. Both Socket and Aikido have lists of affected Red Hat packages and other indicators of compromise that any potentially affected person or organization should make use of promptly. Story updated to add Red Hat comment. Dan Goodin Senior Security Editor Dan Goodin Senior Security Editor Dan Goodin is Senior Security Editor at Ars Technica, where he oversees coverage of malware, computer espionage, botnets, hardware hacking, encryption, and passwords. In his spare time, he enjoys gardening, cooking, and following the independent music scene. Dan is based in San Francisco. Follow him at here on Mastodon and here on Bluesky. Contact him on Signal at DanArs.82. 7 Comments