npm

The eslint-scope Supply Chain Attack

Updated 5 Oct 2026 · Incident date 12 Jul 2018

eslint-scope 3.7.2 and eslint-config-eslint 5.0.2 on npm ran code from a website and sent npm tokens to an attacker on 12 July 2018.

The bad versions were live from 9:49 UTC to 12:37 UTC, about three hours. Version 3.7.1 was clean.

What happened

An attacker used the npm account of an ESLint maintainer. The maintainer had reused the npm password and had no two-factor authentication.

  • The attacker found the password in a third-party breach and created an authentication token.
  • The attacker published both packages with a malicious postinstall script.
  • The script downloaded code from pastebin.com and ran it.
  • That code sent the contents of the user's .npmrc file to the attacker.
  • The GitHub advisory says it sent tokens to two remote servers.

npm revoked all tokens issued before 12:30 UTC on 12 July 2018. Version 3.7.3 of eslint-scope replaced the bad release.

Affected versions

  • eslint-scope 3.7.2 (patched: 3.7.3).
  • eslint-config-eslint 5.0.2 (patched: 6.0.0), and earlier according to the advisory.
  • A machine is exposed if it fetched 3.7.2 in the three-hour window.

Indicators of compromise

  • A postinstall script in the package.json of eslint-scope 3.7.2.
  • A lib/build.js file that fetches code from pastebin.com.
  • A read of ~/.npmrc during install.
  • An install between 9:49 and 12:37 UTC on 12 July 2018.

How to check

List the installed version.

npm ls eslint-scope eslint-config-eslint

Search lockfiles for the bad version.

grep -rn -A1 '"eslint-scope"' package-lock.json | grep 3.7.2

What to do now

  1. Update eslint-scope to 3.7.3 and eslint-config-eslint to 6.0.0 or later.
  2. Revoke all npm tokens that were on any machine that installed the bad version, and create new ones.
  3. Check the packages you publish for versions you did not release.
  4. Use a unique password and turn on two-factor authentication for npm.

What Vigilance would show

These examples show an install hold and the corresponding owner report.

Example install message

Vigilance blocked `eslint-scope` 3.7.2. This version is too new or changed in a way Vigilance must check first.

Example owner report

Bad update

eslint-scope 3.7.2

Installing it now reached out to a website, ran whatever code it found there, and mailed off publishing keys.

See what to do now.

No security team? See who reads the alert.

Frequently asked questions

Which eslint-scope version was malicious?

Version 3.7.2, along with eslint-config-eslint 5.0.2. Version 3.7.3 is the clean replacement.

How did the eslint-scope attack happen?

An attacker used a maintainer's reused password, found in another breach, to publish packages with a postinstall script that stole npm tokens.

Sources

  1. eslint.org/blog/2018/07/postmortem-for-malicious-package-publishes/
  2. github.com/advisories/GHSA-hxxf-q3w9-4xgw

Send this page to the person who looks after AI at your company.

Email it

More supply chain attacks

All 172 attacks in the library · npm supply chain attacks · How to prevent supply chain attacks

Check the next update before you install it

Vigilance compares the version you trust with the new one. It names the one file that gained a power the old version did not have.

Start the free 14-day trialBrowse the attack library