🔍 CVE-2026-48158

0.0
CVSS Score
UNKNOWN
2026-08-10
2026-10-23 20:10
✅ 완료

🇰🇷 한글 설명

use-context-selector는 React의 useContextSelector 훅을 제공하는 패키지입니다. 2026-05-18 15:57:18부터 2026-05-19 15:24:34 사이 기본 브랜치에 악성 커밋이 포함되어, npm install 실행 시 개발자 PC에서 원격 공격자가 제어하는 코드가 실행되었습니다. 해당 커밋은 force-push로 제거되었으나 로컬 클론, 포크, SHA 직접 URL에는 남아 있을 수 있으며, 영향받은 체크아웃에서 npm install을 실행하면 여전히 코드가 실행될 수 있습니다.

💡 쉬운 설명

이 패키지의 설치 과정에 해커가 심은 악성 코드가 들어 있었습니다. 해당 기간에 개발 PC에서 설치를 실행했다면 그 PC와 접근 가능한 계정을 침해된 것으로 보고 비밀번호와 키를 교체해야 합니다.

🇺🇸 원문 (English)

use-context-selector is a React useContextSelector hook in userland Between 2026-05-18 15:57:18 and 2026-05-19 15:24:34, the default branch contained malicious commits 9d8481a513b7b0d1c0941b220c69b25de748641b through 6f2dae054ca014068bdbbb4db96006424d674124 that executed remote attacker-controlled code on developer machines during `npm install`. The commits were removed by force-push, but local clones, forks, and direct-SHA URLs may still contain them, and `npm install` against an affected checkout will still execute the code today. The package was not published to npm. `src/install.js` was added and wired into the `postinstall` script. It fetched a JavaScript payload from an attacker-controlled HTTPS endpoint (configurable via an environment variable), disabled TLS verification, and evaluated the response as code with `require` available. Execution was deliberately skipped on CI and cloud/serverless environments, targeting developer workstations. The second-stage payload was attacker-hosted and cannot be reconstructed. Assume full compromise of anything reachable from a Node process with the user's permissions. Those who ran `npm install` against an affected checkout on a developer machine on or after 2026-05-18 15:57:18 should treat the machine as compromised, rotate every credential the machine could reach, audit account activity** since 2026-05-18 15:57:18, and clean local clones.

📍 영향받는 시스템

2026-05-18 15:57:18 이후 악성 커밋(9d8481a5~6f2dae05)이 포함된 use-context-selector 체크아웃에서 npm install을 실행한 개발자 PC (npm 레지스트리 배포본은 영향 없음)

⚔️ 공격 벡터

postinstall 스크립트(src/install.js)가 공격자 HTTPS 서버에서 JavaScript를 받아 TLS 검증 없이 require 가능한 상태로 eval 실행

🛡️ 대응 방법

해당 기간 체크아웃 삭제 후 깨끗한 버전 재클론, 머신에서 접근 가능했던 모든 자격 증명 교체, 해당 기간 계정 활동 감사 및 침해 여부 점검

🔧 검증 코드

악성 커밋 해시가 출력되면 해당 체크아웃은 영향받은 것이므로 삭제 후 재클론이 필요하고, 'no malicious commit found'가 출력되면 로컬 클론에서는 해당 커밋이 확인되지 않은 것입니다 (단, 해당 기간 npm install 실행 여부는 별도 확인 필요).

Shell / Script
cd "$(find ~ -type d -name use-context-selector 2>/dev/null | head -1)" 2>/dev/null && git log --all --oneline | grep -E '9d8481a513b7b0d1c0941b220c69b25de748641b|6f2dae054ca014068bdbbb4db96006424d674124' || echo 'no malicious commit found'

💻 영향받는 소프트웨어

Oracle Java SE