HackBlue

Labs / Supply chain

One letter off, with an install script

A developer added a dependency by hand. Compare package names with what the team normally uses, find the typosquat, and read the postinstall script it runs on every npm install.

  • Terminal mission
  • Beginner
  • 3 objectives
  • 0 of 3 solved

What you’re looking at

A developer added a dependency by hand. Compare package names with what the team normally uses, find the typosquat, and read the postinstall script it runs on every npm install.

Your goal: Find the lookalike package and the install script it runs on every developer’s machine.

Briefing
the story: what happened and what evidence you were handed.
Terminal
the dark box. It is a pretend Linux shell that runs in your browser. Type a command and press Enter. Nothing you type touches a real system.
Walkthrough
the numbered path. Each step says what to type and what you should see. Hints open one at a time.
Answer boxes
under each question step. Type what you found and press Check.

Words you will meet

CI
continuous integration, the server that builds and tests code

Start with step 1 in the walkthrough. Every step says what to do and what you should see. The whole thing takes about 2 min to talk through.

Briefing

checkout-web’s CI started making an outbound request during npm ci last week. The only dependency change was in package.json, typed by hand during a late fix.

npm runs a package’s preinstall, install, and postinstall scripts automatically. A typosquatted package only needs someone to mistype a name once.

analyst@dev-laptop

dev-laptop · Supply chain

Type help for the command list and objectives for your tasks. Everything runs in this browser.

Up and down arrows walk your history. Ctrl+L clears the screen. Try help, ls, and objectives.

The whole walkthrough

Every step in order, written to be read aloud: 263 words, about 2 min. It gives away every answer, so try the steps first.