← Security

Security 2 min read

Install-hook attack: one unguarded line emptied the key safes of 1,800+ GitHub projects

Is your GitHub safe? Thieves hid a command in the unguarded package list. Fix: --ignore-scripts skips it.

01Was my GitHub project hit by the install-hook attack?

In November, two security firms, Aikido and GitGuardian, found thieves using 4,837 stolen GitHub tokens. In at least 1,806 projects, their code ran inside the automatic build, sent out every key the build could reach, then deleted that build within about a minute.

  • TokenA long-lived GitHub key that works without a password and skips the login code sent to your phone.
  • How tokens get stolenNeither firm says; 431 of these 4,837 were already taken in an October attack. In general, tokens leak through laptop malware or get pasted into public code (our note, not the firms').

A thief holds a stolen GitHub token. It skips the login code sent to your phone.

  1. 1Getting in

    1. A thief holds a stolen GitHub token. It skips the login code sent to your phone.
    2. A harmless 'docs' pull request lands. The token can write.
  2. 2Recipe is guarded

    1. Each change starts a build, which follows the recipe and holds the project's keys.
    2. A stealing step in the recipe? The approval hold stops it: 7 of 7.
  3. 3Package list is open

    1. So the thief hides one line in the package list, the file naming the code a project borrows.
    2. npm runs it during install. Every key goes to the thief.
    3. The run is deleted within a minute. Its number vanishes from the run list.
  4. 4What the keys open

    1. The keys let the build use AWS, npm and AI services. The thief adds their own key.
    2. Deleting the line does not end it. The thief's cloud key still works.
  5. 5The fix

    1. Our advice: install with --ignore-scripts. npm skips the hidden line.
    2. The keys stay put. Lock out the token; change every key.
  1. Problem

    A stolen GitHub token pushes one hidden line into the package list. The build runs it, and GitHub's approval hold does not check that file.

  2. Impact

    Every key the build holds goes to the thief: 18 of the 19 runs seen. The thief's new cloud keys keep working after the line is deleted.

  3. Solution

    Install with --ignore-scripts (our advice). Found the 'docs' pull request? Lock out the token, change every key and delete keys you did not make.

How a stolen GitHub token empties a project's keys through the package list, what those keys open, and how --ignore-scripts closes the route.

02How does the install-hook attack steal GitHub keys?

  • BuildGitHub's computer that tests and ships your project, following a recipe file.
  • SecretsYour AWS, npm and AI keys, on a locked GitHub page, handed to every build.
  • Package listThe file (package.json) naming the code you borrow, plus commands to run after.
  • Install hookSuch a command. npm, the installer, runs it by itself. The thieves added one.

GitHub guards the recipeA change waits for an owner's approval. All 7 such builds the researchers could see were paused. The package list has no guard: of 19 builds seen with the hidden command, 18 sent the keys out.

With the stolen cloud keys, the thieves also made new keys of their own, so deleting the command does not end it.

03How do I fix the install-hook attack?

  • 1. Certain: replace every keyA stolen key works until replaced. Delete the stolen token, change every key in Secrets, and delete cloud keys the thieves made.
  • 2. Our advice: skip install commandsBuild with npm ci --ignore-scripts. npm installs the packages but runs none of their commands, so a hidden one cannot run. Neither firm tested it against this attack; your developer can allow a trusted package's setup step by name.

04Do this today

  • Look for the testSearch your projects for a pull request titled "docs: dependency audit notes" or a branch named wfx-docs (wfx is the thieves' code's own name). Either means that token is stolen.
  • Delete stolen tokensOn GitHub: Settings, then Developer settings, then Personal access tokens. Delete every token you do not recognise or use.
  • Change every keyReplace every key on the project's and organisation's Secrets pages, not only the ones the build uses.
  • Hunt the thieves' keysIn AWS and Azure, delete access keys and logins created since 10 November that nobody on your team made.
  • Close the doorAsk your developer to add --ignore-scripts to the install step of your builds (our advice).

Our idea for GitHub and other tool makers: pause any new command in the package list for an owner's approval, as GitHub already does for the recipe.

TakeawayA stranger's "docs" pull request means your keys are gone. Change them all.

What it doesn't do yet

  • Counts are from the first two days; deleted runs mean the real number of projects hit is likely higher.
  • Neither firm says where the stolen GitHub tokens came from.
  • --ignore-scripts is our advice; neither firm tested it against this attack.

Sources

  1. wfx-loot campaign pushes CI secret stealer to tens of thousands of repositories (Aikido Security, 12 Nov 2026)
  2. wfx-loot: A CI Secret Stealer Pushed With Stolen GitHub Credentials (GitGuardian, Nov 2026)