Code RoomMalicious dependency in build pipeline
HardPrep Room Coding #2721

Malicious dependency in build pipeline

On-callSecurityReliability & on-callSenior–Staff~45 min

Your CI starts making **unexpected outbound connections** to an unknown host during `npm ci`, flagged by egress monitoring on the build runners. Nothing failed; builds are green. Investigation: a transitive dependency published a new **patch** version overnight containing a malicious post-install script that reads env vars (CI secrets) and exfiltrates them. Your lockfile allowed the patch bump because a recent dependency update loosened a pin, and the package's maintainer account was compromised. Some builds in the last 6 hours used the bad version and had access to deploy credentials. How do you triage what leaked, contain, and remediate the supply-chain exposure?

What a strong answer looks like

Stop the bleeding first (mitigate), then form hypotheses from real signals. Separate root cause from symptom, communicate status as you go, and close with what prevents a repeat.

0:00 of about 45 min
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.