StoicBuilder

HandbookXIV the VallumSupply-chain attacks

XIVthe Vallum, Defend it

Supply-chain attacks

1 min readUpdated 28 November

In plain words

A supply-chain attack hides malicious code in something you depend on, such as an npm package, a build tool or a GitHub Action, so it runs with your app's access when you install or build.

Where you see it

A minor update to a date-formatting package adds a postinstall script that reads environment variables and sends them to an unknown server. Harbor's CI runs npm install with deploy keys in its environment, so the script would run there too.

Terminalterminal
npm ci # install exactly what package-lock.json pinsnpm ci --ignore-scripts # where you can, skip packages' install scriptsnpm audit signatures # check registry signatures and provenancenpm audit --omit=dev # known vulnerabilities in what ships
A committed lockfile and npm ci mean CI installs the versions you reviewed, not whatever was published this morning.

What goes wrong

  1. Installing whatever name the agent suggests

    Agents sometimes suggest packages that don't exist, and attackers register those names. Check that a package is real, maintained and widely used before adding it, and watch for near-miss spellings.

  2. Secrets available to every install

    If CI exposes deploy keys while dependencies install, any package's install script can read them. Install in a step without secrets, and give each later step only the secrets it needs.

  3. Versions and tags that move

    A caret range, or a GitHub Action pinned to @v4, can change under you without a commit. Commit the lockfile, use npm ci, and pin third-party Actions to a full commit SHA.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Before adding any package, tell me its weekly downloads, maintainers, last release date and whether it runs install scripts, and confirm the name matches the official docs exactly. In CI, use npm ci with the committed lockfile, install without secrets in the environment, and pin every third-party GitHub Action to a full commit SHA.

Quick check

Sign in to earn +10 XP for it

A new version of a small dependency adds a postinstall script that sends environment variables to an unknown address. Where is Harbor most exposed?

Got a prompt that touches Supply-chain attacks?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.