eslint-config-prettier: a typosquatted npnjs.com phish pushed a Windows DLL into millions of builds
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.
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.
A phishing email masquerading as npmjs.org steals maintainer credentials on npnjs.com and lets the attacker mint a fresh npm publishing token.
Spoofed npmjs emailStolen npm tokenBypassing 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.
Stolen npm token5 tampered npm packagesUnpinned 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.
5 tampered npm packagesinstall.js -> DLL drop
Figure 1. How the attack unfolded, and what stayed isolated. Select any step or box for details.
What they took
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
Require FIDO2/WebAuthn hardware keys on npm maintainer accounts so a typosquatted phishing domain like npnjs.com fails origin binding automatically.
OIDC Trusted Publishing
Disable long-lived maintainer publish tokens and require npm Trusted Publishing with OIDC provenance directly from signed CI workflows.
Disable install scripts
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.
check-eslint-prettier-compromise.shCheck lockfiles for compromised eslint-config-prettier versions (CVE-2025-54313).
#!/usr/bin/env bashset -euo pipefailgrep -rnE '"eslint-config-prettier".*(8\.10\.1|9\.1\.1|10\.1\.6|10\.1\.7)' \ package-lock.json pnpm-lock.yaml yarn.lock 2>/dev/null \ && echo "ALERT: Compromised CVE-2025-54313 version present" \ || echo "Clean: no compromised eslint-config-prettier versions found"Appendix
Evidence log: what’s confirmed and what’s withheld
| Claim | Status | Source |
|---|---|---|
| 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 |
| 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 |
| 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
npnjs[.]comnode-gyp.dll (dropped by install.js)eslint-config-prettier@8.10.1, 9.1.1, 10.1.6, 10.1.7
Reproduction lab
Verify your workspace lockfiles are free of the July 2025 versions and test running package installs with lifecycle scripts disabled.
bash check-eslint-prettier-compromise.sh
npm config get ignore-scripts