# eslint-config-prettier: a typosquatted npnjs.com phish pushed a Windows DLL into millions of builds

- **Canonical URL:** https://breachidents.com/incidents/eslint-config-prettier-jul-2025-npm-phish
- **Organization:** eslint-config-prettier
- **Incident date:** Jul 18–19, 2025
- **Disclosed / updated:** Jul 19, 2025
- **Category:** CI supply chain
- **Primary source:** Maintainer Disclosure (prettier/eslint-config-prettier#339) and NVD CVE-2025-54313 (https://github.com/prettier/eslint-config-prettier/issues/339)

## In 30 seconds

- **How they got in:** Spoofed npmjs.org verification email sent maintainer to npnjs.com and captured publish credentials _[Confirmed]_
- **What leaked / reached:** eslint-config-prettier (8.10.1, 9.1.1, 10.1.6, 10.1.7), eslint-plugin-prettier, synckit, @pkgr/core, and napi-postinstall on npm, executing node-gyp.dll on Windows installs
- **What stayed safe:** GitHub source repositories (no malicious commits pushed), Linux and macOS environments skipped by the Windows-only DLL check, and lockfile-pinned pipelines

## Summary

On July 18, 2025, an attacker phished a maintainer of eslint-config-prettier using a lookalike domain (npnjs.com), added a publishing token, and pushed tampered versions of eslint-config-prettier along with eslint-plugin-prettier, synckit, @pkgr/core, and napi-postinstall. Tracked as CVE-2025-54313, the tampered packages ran an install.js postinstall script targeting Windows hosts to execute a malicious node-gyp.dll payload. Linux and macOS build runners were skipped by the platform check, and npm removed the bad versions within hours.

## Attack sequence

1. **Jul 18, 2025 — Spoofed npmjs.org email lures maintainer to typosquatted npnjs.com:** A phishing email masquerading as npmjs.org steals maintainer credentials on npnjs.com and lets the attacker mint a fresh npm publishing token.
2. **Jul 18–19, 2025 — Attacker publishes tampered patch versions across 5 npm packages directly:** Bypassing GitHub completely, the attacker pushes eslint-config-prettier 8.10.1, 9.1.1, 10.1.6, and 10.1.7 alongside four sibling packages, each carrying a new install.js hook.
3. **Jul 19, 2025 — Windows installs trigger node-gyp.dll before community reports and npm takedown:** Unpinned Windows installs run install.js and execute node-gyp.dll (CVE-2025-54313) until maintainers spot the rogue versions on Issue #339 and npm purges them.

## How they got in

Dev dependencies look harmless because they never ship to production users, yet they run with full developer and CI runner privileges every time a project installs packages. On July 18, 2025, an attacker sent a phishing email impersonating `npmjs.org` to maintainer JounQin, routing him to a one-letter typosquat at `npnjs.com`.

Once the attacker captured credentials on the fake domain, they created a fresh npm publish token and bypassed GitHub completely. No pull request was opened, no code review triggered, and no malicious commit ever touched the `prettier/eslint-config-prettier` repository.

## What it reached

Using the stolen token, the attacker pushed unauthorized patch versions across five packages maintained by the same account: `eslint-config-prettier` (`8.10.1`, `9.1.1`, `10.1.6`, `10.1.7`), `eslint-plugin-prettier`, `synckit`, `@pkgr/core`, and `napi-postinstall`. Because projects commonly specify caret ranges (`^10.1.5`) in `package.json`, any fresh `npm install` without a locked dependency graph immediately pulled the poisoned patch bumps.

Tracked as CVE-2025-54313, each tampered tarball added an `install.js` lifecycle hook that checked for Windows and launched a bundled `node-gyp.dll` payload. Community developers spotted the bizarre addition of a binary DLL inside a pure-JSON ESLint config package within hours on GitHub Issue #339, prompting immediate token revocation and registry takedowns.

## What stayed safe

Three simple engineering controls stopped the blast for teams that already used them. First, GitHub repositories stayed completely clean because the attacker published directly to npm without provenance. Second, Linux and macOS machines were ignored by the Windows-only DLL trigger. Third, teams enforcing frozen lockfiles (`npm ci` or `pnpm install --frozen-lockfile`) and disabling lifecycle scripts (`ignore-scripts=true`) never pulled or ran the rogue releases.

## How to defend against this

- **Hardware passkey MFA** (Stops step 1): Require FIDO2/WebAuthn hardware keys on npm maintainer accounts so a typosquatted phishing domain like npnjs.com fails origin binding automatically.
- **OIDC Trusted Publishing** (Stops step 2): Disable long-lived maintainer publish tokens and require npm Trusted Publishing with OIDC provenance directly from signed CI workflows.
- **Disable install scripts** (Stops step 3): Set ignore-scripts=true in CI and developer .npmrc files, and enforce frozen lockfiles (npm ci / pnpm install --frozen-lockfile) with a minimum release-age cooldown.

## Evidence log

| Section | Claim | Evidence state | Source |
| --- | --- | --- | --- |
| How they got in | Maintainer JounQin clicked a spoofed npmjs.org phishing link pointing to npnjs.com, giving the attacker credentials to mint an npm publish token | Confirmed | Maintainer disclosure on GitHub (prettier/eslint-config-prettier#339), Jul 19, 2025 |
| What it reached | Tampered versions 8.10.1, 9.1.1, 10.1.6, and 10.1.7 of eslint-config-prettier plus eslint-plugin-prettier, synckit, @pkgr/core, and napi-postinstall were published with install.js executing Windows node-gyp.dll (CVE-2025-54313) | Confirmed | NVD CVE-2025-54313 and prettier/eslint-config-prettier#339 |
| What held | GitHub source repositories remained clean, Linux and macOS hosts did not execute the Windows DLL, and lockfile-pinned builds avoided the rogue patch versions | Confirmed | Maintainer disclosure and CVE-2025-54313 technical analysis |

## Indicators of compromise

- **Domain:** `npnjs[.]com` (undefined)
- **File:** `node-gyp.dll (dropped by install.js)` (undefined)
- **Package:** `eslint-config-prettier@8.10.1, 9.1.1, 10.1.6, 10.1.7` (undefined)

---
Published by [breachidents](https://breachidents.com). Preserve evidence labels (Confirmed / Inferred / Withheld by vendor / Observed) when citing.
