🔍 CVE-2021-24105

8.4
CVSS Score
HIGH
2021-02-25
2026-06-17 03:39
✅ 완료

🇰🇷 한글 설명

패키지 관리자 설정에 따라 공격자가 공용 저장소에 악성 패키지를 삽입하여 개발, 빌드 및 배포 과정에서 실행되게 할 수 있는 취약점입니다. 이 취약점은 Python/pip, .NET/NuGet, Java/Maven, JavaScript/npm 등 다양한 언어의 패키지 관리자에 영향을 미칠 수 있으며 원격 코드 실행으로 이어질 수 있습니다.

💡 쉬운 설명

회사 내부에서만 쓰는 프로그램 이름과 똑같은 이름의 가짜 프로그램을 인터넷 공개 저장소에 올려두어, 컴퓨터가 실수로 가짜를 다운로드하게 만드는 공격입니다. 이를 통해 해커는 사용자의 컴퓨터에 몰래 침투하여 명령을 내릴 수 있습니다.

🇺🇸 원문 (English)

<p>Depending on configuration of various package managers it is possible for an attacker to insert a malicious package into a package manager's repository which can be retrieved and used during development, build, and release processes. This insertion could lead to remote code execution. We believe this vulnerability affects multiple package managers across multiple languages, including but not limited to: Python/pip, .NET/NuGet, Java/Maven, JavaScript/npm.</p> <p><strong>Attack scenarios</strong></p> <p>An attacker could take advantage of this ecosystem-wide issue to cause harm in a variety of ways. The original attack scenarios were discovered by Alex Birsan and are detailed in their whitepaper, <a href="https://medium.com/@alex.birsan/dependency-confusion-4a5d60fec610">Dependency Confusion: How I Hacked Into Apple, Microsoft and Dozens of Other Companies</a>.</p> <ul> <li><p>With basic knowledge of the target ecosystems, an attacker could create an empty shell for a package and insert malicious code in the install scripts, give it a high version, and publish it to the public repository. Vulnerable victim machines will download the higher version of the package between the public and private repositories and attempt to install it. Due to code incompatibility it will probably error out upon import or upon compilation, making it easier to detect; however the attacker would have gained code execution by that point.</p> </li> <li><p>An advanced attacker with some inside knowledge of the target could take a copy of a working package, insert the malicious code (in the package itself or in the install), and then publish it to a public repository. The package will likely install and import correctly, granting the attacker an initial foothold and persistence.</p> </li> </ul> <p>These two methods could affect target organizations at any of these various levels:</p> <ul> <li>Developer machines</li> <li>An entire team if the configuration to import the malicious package is uploaded to a code repository</li> <li>Continuous integration pipelines if they pull the malicious packages during the build, test, and/or deploy stages</li> <li>Customers, download servers, production services if the malicious code has not been detected</li> </ul> <p>This remote code execution vulnerability can only be addressed by reconfiguring installation tools and workflows, and not by correcting anything in the package repositories themselves. See the <strong>FAQ</strong> section of this CVE for configuration guidance.</p>

📍 영향받는 시스템

Python/pip, .NET/NuGet, Java/Maven, JavaScript/npm 등 다양한 패키지 관리자를 사용하는 환경

⚔️ 공격 벡터

공용 저장소에 내부 패키지보다 높은 버전 번호를 가진 악성 패키지를 업로드하여 의존성 혼란(Dependency Confusion) 유도

🛡️ 대응 방법

패키지 관리자의 설정 및 워크플로우를 재구성하여 내부 저장소 우선순위를 지정하거나 스코프(Scope)를 사용하도록 변경

🔧 검증 코드

설치된 패키지 목록 중 의심스러운 이름이나 버전이 공용 저장소에서 유입되었는지 확인

Shell / Script
npm list -g --depth=0 || pip list || dotnet list package

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

💻 영향받는 소프트웨어

.NET