Cremit
/incidentsfield log
탐지캠페인유출지패턴LLM사고 사례방법론
↺rss↗cremit.io

incidents.cremit.io

실제 발생한 비인간 식별자(NHI) 크리덴셜 유출 사고를 정리한 인덱스. 운영: Cremit

둘러보기

  • 전체 사고
  • npm 공급망
  • CI/CD 침해
  • 방법론

구독

  • RSS 피드
  • @cremit_io
  • GitHub
// 상태
모니터 가동중
// 빌드
2026-05-20
// 출처
cremit · 서울, 대한민국
// 라이선스
CC BY 4.0

© 2026 Cremit. 출처 표시 시 자유롭게 재사용 가능.

홈/사고/ua-parser-js-compromise-2021
CRITICAL8.8·confirmed·공개 Oct 22, 2021·5분 분량

ua-parser-js npm Account Compromise (2021)

An attacker took over the maintainer account of ua-parser-js — a package with ~7M weekly downloads — and shipped versions containing a credential stealer (Windows) and a cryptominer (Linux).

Summary

On October 22, 2021, attackers gained publish access to the npm account of Faisal Salman, the maintainer of ua-parser-js, and shipped three malicious versions — 0.7.29, 0.8.0, and 1.0.0. The package had roughly 7 million weekly downloads and is a transitive dependency in Facebook, Microsoft, Amazon, IBM, and many other large codebases. The malicious versions executed a platform-aware payload: Linux installs got an XMRig cryptominer, Windows installs got the same miner plus a credential-stealing trojan that harvested browser-stored passwords, cryptocurrency wallets, and operating-system credentials. CISA issued an alert the same day urging immediate inspection and rotation.

Timeline

  • 2021-10-22 ~12:15 UTC — Malicious ua-parser-js@0.7.29 published.
  • 2021-10-22 ~12:39 UTC — 1.0.0 published.
  • 2021-10-22 ~14:25 UTC — 0.8.0 published.
  • 2021-10-22 ~17:00 UTC — Maintainer Faisal Salman opens GitHub issue #536 confirming his npm account was compromised and the malicious versions were not his.
  • 2021-10-22 ~18:00 UTC — npm removes all three versions; clean replacements published.
  • 2021-10-22 evening — CISA publishes alert recommending all installs of the affected versions be considered fully compromised.

Attack Vector

The npm account was hijacked. The maintainer described the takeover as the result of a credential compromise outside of GitHub (no specific vector was confirmed publicly). Once the attacker had publish access, the technical chain was:

  1. Three escalating-severity versions published in rapid succession to maximize the reach window before detection.
  2. A preinstall script in the package ran on every install, executing a platform-specific payload.
  3. On Linux: a shell script downloaded and executed an XMRig cryptominer binary (jsextension).
  4. On Windows: the script downloaded both XMRig and a create.dll file identified by multiple AV vendors as a variant of the DanaBot banking trojan / credential stealer.
  5. DanaBot then performed standard credential harvesting: browser password stores, browser cookie jars, FTP credentials, cryptocurrency wallet files, and Windows credential vault contents.

Tokens & Credentials Exposed

The Windows payload's harvest scope is what makes this incident a credential incident, not just a cryptominer incident:

  • Browser-stored credentials — Chrome, Edge, Firefox password stores. For developers, this typically includes session tokens for GitHub, npm, AWS console, and SaaS dashboards.
  • Browser cookies — full session cookie databases, allowing post-2FA session resumption attacks.
  • FTP credentials stored in popular FTP clients (FileZilla, etc.).
  • Cryptocurrency wallet files — wallet.dat, MetaMask local storage, hardware wallet companion app data.
  • Operating system credentials — Windows Credential Manager contents, including any cached domain credentials.

For an organization whose developer workstation pulled the malicious version, the practical exposure was every credential the developer's browser had ever logged into and every credential their OS had ever cached.

Confirmed Impact

  • CISA emergency alert issued same-day, treating any install of affected versions as fully compromised.
  • Multiple Fortune-500 incident response activations in the days following, focused on developer workstation forensics and credential rotation.
  • DanaBot infrastructure correlation: the C2 endpoints used by the malicious payload were tied to existing DanaBot operations, suggesting a credential-stealing-as-a-service model rather than a one-off attack.
  • No specific number of compromised organizations was published; given the package's ~7M weekly download volume and ~6-hour exposure window, the absolute count is presumed large.

Mitigation & Lessons

If you operated a development workstation or CI runner that installed ua-parser-js@0.7.29, 0.8.0, or 1.0.0:

  • Treat the host as fully compromised. Reformat developer workstations; rebuild CI runners from clean images.
  • Rotate every credential the host could plausibly have touched. Browser-stored credentials, cloud provider keys, source control tokens, OS credentials — assume the entire credential graph reachable from the host is exposed.
  • Audit for persistence. DanaBot maintains persistence via scheduled tasks and registry run keys. A clean reformat is the only reliable removal.

The structural lessons mirror the 2018 ESLint incident:

  • preinstall hooks remain a sharp edge in the npm ecosystem. They run before any code review opportunity.
  • Account compromise via credential reuse continues to be the dominant npm account takeover vector. 2FA enforcement for top packages is the single most effective control.
  • Lockfile pinning + provenance + reproducible builds is the modern multi-layer defense. Lockfile pinning alone would have rejected the malicious version unless the project explicitly ran npm install (re-resolution) during the window.

Cremit Analysis

This incident is ghost-key, drifted-key, and unattributed-key all at once.

Ghost Key: the npm account credential — held by a single maintainer for years — was the only identity gating publish rights to a package consumed by hundreds of millions of dependent installs. There is no second face on the credential to ping when something looks off.

Drifted Key: ua-parser-js was originally a small utility for parsing browser User-Agent strings. It had drifted into production dependency trees of every major cloud provider and OS vendor by 2021. The trust model and security posture appropriate for a small utility (one maintainer, no review) was wildly inappropriate for the blast radius the package had accumulated.

Unattributed Key: every credential the malicious payload exfiltrated from a developer workstation was, in most organizations, not mapped to a specific workload, lifecycle policy, or rotation owner. After the incident, organizations that took it seriously spent days reconstructing what their developer machines actually held. Many credentials likely never got rotated because nobody knew they existed.

The NHI Severity Index score of 8.8 reflects ecosystem-wide blast radius (one of the most-installed packages in the registry), production reachability (any credentials the affected workstation touched), and variable privilege levels.

The incident also established the platform-aware preinstall pattern that the Shai-Hulud campaign of 2025–2026 would refine: detect the host environment, deliver a payload calibrated for the maximum credential yield available on that host. The Bitwarden CLI compromise targeting CI runners with cloud tokens, AI tooling configs, and SSH keys is the direct descendent of the technique introduced here.


참고 자료

  1. [1]
    ua-parser-js GitHub issue #536 — original disclosure
    primary·2021-10-22·github.com
  2. [2]
    GitHub Security Advisory GHSA-pjwm-rvh2-c87w
    primary·2021-10-22·github.com
  3. [3]
    CISA — Malware Discovered in Popular NPM Package, ua-parser-js
    primary·2021-10-22·cisa.gov
  4. [4]
    Popular NPM library hijacked to install password-stealers, miners
    reporting·2021-10-22·bleepingcomputer.com

관련 사고

2018-11-26·HIGH
event-stream / flatmap-stream Backdoor (2018)
2018-07-12·HIGH
eslint-scope npm Publish Token Theft (2018)
2021-11-04·CRITICAL
rc and coa Coordinated npm Account Takeover (2021)
2026-04-22·CRITICAL
Bitwarden CLI Supply Chain Compromise (2026)
최종 검토 / 2026-05-04검토자 / ben라이선스 / CC BY 4.0
// 사고 메타데이터
심각도
CRITICAL8.8
상태
confirmed
공개
2021-10-22
발생
2021-10-22 → 2021-10-22
벡터
npm supply chain
플랫폼
npm
토큰
API Key (generic)Database CredentialEnvironment VariableSigning Key
nhi severity index
점수8.8 / 10blast radiusecosystem-widereachabilityproduction권한variable
nhi kill chain
Ghost Key↗Drifted Key↗Unattributed Key↗
지표
노출 기간1일