{"incident":{"slug":"eslint-config-prettier-jul-2025-npm-phish","caseId":"BI-2025-011","organization":"eslint-config-prettier","title":"eslint-config-prettier: a typosquatted npnjs.com phish pushed a Windows DLL into millions of builds","shortSummary":"Phishing spoofed npmjs.org at npnjs.com to steal a maintainer’s npm token and publish tampered versions of eslint-config-prettier and four sibling packages carrying a Windows node-gyp.dll payload.","lede":"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.","incidentDate":"Jul 18–19, 2025","incidentDateIso":"2025-07-18","incidentEndIso":"2025-07-19","disclosedDate":"Jul 19, 2025","sourceUrl":"https://github.com/prettier/eslint-config-prettier/issues/339","sourceAuthor":"Maintainer Disclosure (prettier/eslint-config-prettier#339) and NVD CVE-2025-54313","vectorFilter":"CI supply chain","timeToDetect":"Hours (reported July 19, 2025)","detectedBy":"Community maintainers and automated package scanners","initialAccess":{"label":"Maintainer npm phishing (npnjs.com)","detail":"Spoofed npmjs.org verification email sent maintainer to npnjs.com and captured publish credentials","evidence":"confirmed"},"blastRadius":"5 widely used JS dev-dependency packages (30M+ weekly downloads for eslint-config-prettier)","whatItReachedShort":"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","whatHeldShort":"GitHub source repositories (no malicious commits pushed), Linux and macOS environments skipped by the Windows-only DLL check, and lockfile-pinned pipelines","revisions":[{"id":"Rev A","date":"Jul 19, 2025","note":"Published from prettier/eslint-config-prettier#339, maintainer phishing disclosure, and NVD record CVE-2025-54313."}],"bodyMarkdown":"## How they got in\n\nDev 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`.\n\nOnce 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.\n\n## What it reached\n\nUsing 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.\n\nTracked 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.\n\n## What held\n\nThree 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.\n\n> **Why this matters for defenders**\n>\n> A formatting config package should never execute native binaries at install time. Hardware WebAuthn passkeys block lookalike phishing domains like `npnjs.com`, npm OIDC Trusted Publishing eliminates static publish tokens, and disabling install scripts by default removes the entire postinstall execution surface from developer laptops and CI runners.","narrative":{"howTheyGotIn":["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."],"whatItReached":["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."],"whatHeld":["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."],"sideNoteTitle":"Why this matters for defenders","sideNoteParagraphs":["A formatting config package should never execute native binaries at install time. Hardware WebAuthn passkeys block lookalike phishing domains like `npnjs.com`, npm OIDC Trusted Publishing eliminates static publish tokens, and disabling install scripts by default removes the entire postinstall execution surface from developer laptops and CI runners."]},"claims":[{"group":"How they got in","claim":"Maintainer JounQin clicked a spoofed npmjs.org phishing link pointing to npnjs.com, giving the attacker credentials to mint an npm publish token","evidence":"confirmed","source":"Maintainer disclosure on GitHub (prettier/eslint-config-prettier#339), Jul 19, 2025"},{"group":"What it reached","claim":"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)","evidence":"confirmed","source":"NVD CVE-2025-54313 and prettier/eslint-config-prettier#339"},{"group":"What held","claim":"GitHub source repositories remained clean, Linux and macOS hosts did not execute the Windows DLL, and lockfile-pinned builds avoided the rogue patch versions","evidence":"confirmed","source":"Maintainer disclosure and CVE-2025-54313 technical analysis"}],"diagram":{"label":"How a lookalike npnjs.com phishing link poisoned eslint-config-prettier and sibling npm packages","zones":[{"id":"ext","label":"Phishing lure","kind":"boundary","lane":0},{"id":"reg","label":"Maintainer & npm registry","kind":"boundary","lane":1},{"id":"dev","label":"Developer & CI installs","kind":"boundary","lane":2},{"id":"safe","label":"Skipped or pinned","kind":"isolated","lane":2}],"nodes":[{"id":"ec-phish","zone":"ext","name":"Spoofed npmjs email","detail":"Lookalike npnjs.com site","kind":"attacker","ev":"confirmed","at":0,"when":"Jul 18, 2025","steps":[1],"ctl":["ec-k1"],"story":"An attacker sent an email impersonating npmjs.org directing maintainer JounQin to the typosquatted domain npnjs.com to verify account details."},{"id":"ec-tok","zone":"reg","name":"Stolen npm token","detail":"Bypassed GitHub CI","kind":"compromised","ev":"confirmed","at":1,"when":"Jul 18, 2025","steps":[1,2],"ctl":["ec-k2"],"story":"With the captured credentials, the attacker created an unauthorized npm publish token with rights across every package the maintainer controlled."},{"id":"ec-pkg","zone":"reg","name":"5 tampered npm packages","detail":"8.10.1, 9.1.1, 10.1.6–7","kind":"compromised","ev":"confirmed","at":2,"when":"Jul 18–19, 2025","steps":[2,3],"story":"The attacker published unauthorized versions of eslint-config-prettier (8.10.1, 9.1.1, 10.1.6, 10.1.7) plus eslint-plugin-prettier, synckit, @pkgr/core, and napi-postinstall."},{"id":"ec-dll","zone":"dev","name":"install.js -> DLL drop","detail":"Windows node-gyp.dll","kind":"compromised","ev":"confirmed","at":3,"when":"Jul 18–19, 2025","steps":[3],"ctl":["ec-k3"],"story":"On Windows hosts, the added install.js postinstall script launched rundll32 against a bundled malicious node-gyp.dll (CVE-2025-54313)."},{"id":"ec-safe","zone":"safe","name":"Git repo & Linux/macOS","detail":"Pinned lockfiles held","kind":"isolated","ev":"confirmed","at":0,"when":"Not reached","story":"No malicious code was ever committed to GitHub, Linux and macOS hosts were bypassed by the Windows check, and CI jobs running frozen lockfiles ignored the unpinned patch bumps."}],"edges":[{"id":"ece1","from":"ec-phish","to":"ec-tok","kind":"attack","step":1},{"id":"ece2","from":"ec-tok","to":"ec-pkg","kind":"attack","step":2},{"id":"ece3","from":"ec-pkg","to":"ec-dll","kind":"attack","step":3}],"steps":[{"n":1,"time":"Jul 18, 2025","short":"Jul 18","text":"Spoofed npmjs.org email lures maintainer to typosquatted npnjs.com","say":"A phishing email masquerading as npmjs.org steals maintainer credentials on npnjs.com and lets the attacker mint a fresh npm publishing token."},{"n":2,"time":"Jul 18–19, 2025","short":"Jul 18–19","text":"Attacker publishes tampered patch versions across 5 npm packages directly","say":"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."},{"n":3,"time":"Jul 19, 2025","short":"Jul 19","text":"Windows installs trigger node-gyp.dll before community reports and npm takedown","say":"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."}],"controls":[{"id":"ec-k1","step":1,"kind":"control","nodeId":"ec-phish","name":"Hardware passkey MFA","tag":"Stops step 1","long":"Require FIDO2/WebAuthn hardware keys on npm maintainer accounts so a typosquatted phishing domain like npnjs.com fails origin binding automatically."},{"id":"ec-k2","step":2,"kind":"control","nodeId":"ec-tok","name":"OIDC Trusted Publishing","tag":"Stops step 2","long":"Disable long-lived maintainer publish tokens and require npm Trusted Publishing with OIDC provenance directly from signed CI workflows."},{"id":"ec-k3","step":3,"kind":"control","nodeId":"ec-dll","name":"Disable install scripts","tag":"Stops step 3","long":"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."}],"detectedAt":{"time":"Jul 19, 2025","short":"Jul 19, 2025","text":"Community researchers flagged the unexpected install.js and node-gyp.dll additions on prettier/eslint-config-prettier#339 within hours; tokens were revoked and bad releases purged."}},"plate":{"W":815,"H":380,"label":"How a lookalike npnjs.com phishing link poisoned eslint-config-prettier and sibling npm packages","zones":[{"id":"ext","label":"Phishing lure","kind":"boundary","x":8,"y":16,"w":226,"h":110},{"id":"reg","label":"Maintainer & npm registry","kind":"boundary","x":272,"y":16,"w":254,"h":212},{"id":"dev","label":"Developer & CI installs","kind":"boundary","x":564,"y":16,"w":243,"h":110},{"id":"safe","label":"Skipped or pinned","kind":"isolated","x":564,"y":146,"w":243,"h":110}],"nodes":[{"id":"ec-phish","name":"Spoofed npmjs email","detail":"Lookalike npnjs.com site","kind":"attacker","ev":"confirmed","x":20,"y":52,"w":202,"at":0,"story":"An attacker sent an email impersonating npmjs.org directing maintainer JounQin to the typosquatted domain npnjs.com to verify account details.","when":"Jul 18, 2025","steps":[1],"ctl":["ec-k1"]},{"id":"ec-tok","name":"Stolen npm token","detail":"Bypassed GitHub CI","kind":"compromised","ev":"confirmed","x":284,"y":52,"w":230,"at":1,"story":"With the captured credentials, the attacker created an unauthorized npm publish token with rights across every package the maintainer controlled.","when":"Jul 18, 2025","steps":[1,2],"ctl":["ec-k2"]},{"id":"ec-pkg","name":"5 tampered npm packages","detail":"8.10.1, 9.1.1, 10.1.6–7","kind":"compromised","ev":"confirmed","x":284,"y":154,"w":230,"at":2,"story":"The attacker published unauthorized versions of eslint-config-prettier (8.10.1, 9.1.1, 10.1.6, 10.1.7) plus eslint-plugin-prettier, synckit, @pkgr/core, and napi-postinstall.","when":"Jul 18–19, 2025","steps":[2,3]},{"id":"ec-dll","name":"install.js -> DLL drop","detail":"Windows node-gyp.dll","kind":"compromised","ev":"confirmed","x":580,"y":52,"w":211,"at":3,"story":"On Windows hosts, the added install.js postinstall script launched rundll32 against a bundled malicious node-gyp.dll (CVE-2025-54313).","when":"Jul 18–19, 2025","steps":[3],"ctl":["ec-k3"]},{"id":"ec-safe","name":"Git repo & Linux/macOS","detail":"Pinned lockfiles held","kind":"isolated","ev":"confirmed","x":576,"y":182,"w":219,"at":0,"story":"No malicious code was ever committed to GitHub, Linux and macOS hosts were bypassed by the Windows check, and CI jobs running frozen lockfiles ignored the unpinned patch bumps.","when":"Not reached"}],"edges":[{"id":"ece1","kind":"attack","step":1,"pts":[[222,81],[284,81]]},{"id":"ece2","kind":"attack","step":2,"pts":[[399,110],[399,154]]},{"id":"ece3","kind":"attack","step":3,"pts":[[514,183],[547,183],[547,81],[580,81]]}],"balloons":{"1":[253,81],"2":[399,132],"3":[547,132]},"noroute":[{"x1":526,"x2":564,"y":188,"label":"No route"}],"bps":[{"id":"ec-k1","step":1,"kind":"control","at":[253,81],"name":"Hardware passkey MFA","tag":"Stops step 1","lead":[[253,70],[253,53],[265,53]],"lx":271,"ly":57,"anchor":"start","long":"Require FIDO2/WebAuthn hardware keys on npm maintainer accounts so a typosquatted phishing domain like npnjs.com fails origin binding automatically.","nodeId":"ec-phish"},{"id":"ec-k2","step":2,"kind":"control","at":[399,132],"name":"OIDC Trusted Publishing","tag":"Stops step 2","lead":[[399,143],[399,154],[411,154]],"lx":417,"ly":158,"anchor":"start","long":"Disable long-lived maintainer publish tokens and require npm Trusted Publishing with OIDC provenance directly from signed CI workflows.","nodeId":"ec-tok"},{"id":"ec-k3","step":3,"kind":"control","at":[547,132],"name":"Disable install scripts","tag":"Stops step 3","lead":[[547,121],[547,104],[535,104]],"lx":529,"ly":108,"anchor":"end","long":"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.","nodeId":"ec-dll"}],"steps":[{"n":1,"time":"Jul 18, 2025","short":"Jul 18","text":"Spoofed npmjs.org email lures maintainer to typosquatted npnjs.com","say":"A phishing email masquerading as npmjs.org steals maintainer credentials on npnjs.com and lets the attacker mint a fresh npm publishing token."},{"n":2,"time":"Jul 18–19, 2025","short":"Jul 18–19","text":"Attacker publishes tampered patch versions across 5 npm packages directly","say":"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."},{"n":3,"time":"Jul 19, 2025","short":"Jul 19","text":"Windows installs trigger node-gyp.dll before community reports and npm takedown","say":"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."}],"stripRows":[{"id":"sr-ec-phish","nodeId":"ec-phish","lineStyle":"solid"},{"id":"sr-step-1","nodeId":"ec-tok","step":1,"lineStyle":"solid","bpIds":["ec-k1"]},{"id":"sr-step-2","nodeId":"ec-pkg","step":2,"lineStyle":"solid","bpIds":["ec-k2"]},{"id":"sr-step-3","nodeId":"ec-dll","step":3,"lineStyle":"none","bpIds":["ec-k3"]}],"detectedAt":{"time":"Jul 19, 2025","short":"Jul 19, 2025","text":"Community researchers flagged the unexpected install.js and node-gyp.dll additions on prettier/eslint-config-prettier#339 within hours; tokens were revoked and bad releases purged."}},"codeArtifacts":[{"id":"ec-lockfile-scan","filename":"check-eslint-prettier-compromise.sh","language":"sh","description":"Check lockfiles for compromised eslint-config-prettier versions (CVE-2025-54313).","code":"#!/usr/bin/env bash\nset -euo pipefail\ngrep -rnE '\"eslint-config-prettier\".*(8\\.10\\.1|9\\.1\\.1|10\\.1\\.6|10\\.1\\.7)' \\\n  package-lock.json pnpm-lock.yaml yarn.lock 2>/dev/null \\\n  && echo \"ALERT: Compromised CVE-2025-54313 version present\" \\\n  || echo \"Clean: no compromised eslint-config-prettier versions found\"\n"}],"reproductionLab":{"title":"Lockfile & install-script guard check","summary":"Verify your workspace lockfiles are free of the July 2025 versions and test running package installs with lifecycle scripts disabled.","bundleMeta":"Shell audit script, MIT license","safetyNote":"Read-only scan of local lockfiles.","commands":"bash check-eslint-prettier-compromise.sh\nnpm config get ignore-scripts\n"},"iocs":[{"type":"Domain","value":"npnjs[.]com","note":"Typosquatted npmjs.org phishing domain used to capture maintainer credentials","evidence":"confirmed"},{"type":"File","value":"node-gyp.dll (dropped by install.js)","note":"Windows DLL executed during npm install on compromised versions (CVE-2025-54313)","evidence":"confirmed"},{"type":"Package","value":"eslint-config-prettier@8.10.1, 9.1.1, 10.1.6, 10.1.7","note":"Tampered npm releases purged by npm Security on July 19, 2025","evidence":"confirmed"}],"publishedAt":"2025-07-19T20:00:00Z","origin":"editorial"}}