Lion Cipher Lab

Audit and fix vulnerable npm dependencies with npm audit

Why it matters

You write a few hundred lines; you ship a few hundred thousand. A plain Node project with three dependencies in this lab installs a tree whose real risk lives in a package you never typed the name of. That is exactly where attackers look, and it is why "Vulnerable and Outdated Components" is its own entry in the OWASP Top 10. The good news is that the npm toolchain already knows which of your installed versions have published advisories: `npm audit` reads your lockfile, checks every package against the registry's advisory database, and tells you the severity, the advisory, and the dependency…

What you'll learn

Steps in this lab

  1. Why the risk is in the code you did not write
  2. Confirm Node and npm, and make an empty folder
  3. Create a deliberately vulnerable project and an OLD lockfile
  4. Run npm audit and read every field (BEFORE)
  5. Fix the safe ones with npm audit fix (3 -> 2)
  6. Fix the transitive one with overrides (2 -> 0)
  7. The honest negative: what --force and audit itself will not tell you
  8. The judgment: fix, override, accept, and gate it in CI
  9. Clean up

Open the full interactive lab →