Get Started

Find the risk hiding in your project's dependencies

Almost every project you build stands on other people's code: the packages you install, and the packages those packages install in turn. Any one of them can carry a published, known security flaw, or be a hostile lookalike of a package you meant to install. In this mission you build two small projects on your own machine, one npm and one Python, each with deliberately old, vulnerable dependencies. You run real audits (npm audit and pip-audit), read the advisory ids and severities they return, then upgrade and pin and watch the same audit come back clean. You learn what a lockfile is and why it matters, how to inspect a package before you install it, and how to spot a typosquat before it bites. Everything runs against your own projects. It is defensive supply-chain work, and it pairs with Read a CVE and reproduce it, which goes deep on a single flaw.

54 minIntermediateTools: FreeStep 1 free
Tested 12 Oct 2026 · npm 11.19.0 on Node.js 26.7.0, and pip-audit 2.10.1 run through uv 0.11.9 with CPython 3.13.5, all on Windows 11 using PowerShell. The npm sample pinned lodash 4.17.11 and minimist 1.2.0; the Python sample pinned requests 2.19.1 and PyYAML 5.3.1 installed into a uv-managed Python 3.9.25 environment, with the patched set (requests 2.33.0, PyYAML 6.0.2) resolved under Python 3.11.15. Advisory data comes from npm's registry audit endpoint and from pip-audit's PyPI and OSV data; counts and advisory ids move as new advisories are published, so your numbers will differ from these. No malicious or typosquat package was installed at any point: the npm view lookup of a lookalike name only reads public registry metadata.
Two real audits on your own machine with the fixes provedan npm project goes from two critical advisories (named lodash and minimist flaws, with their GHSA ids) to zero, and a Python project goes from dozens of findings (requests, PyYAML and their transitive dependencies, with PYSEC ids and fix versions) to a clean report, with you measuring the before and after both times
The skill of reading an audit properlythe advisory id, the severity, whether a fix exists and the version that carries it, and the difference between a dependency you chose and a transitive one that came along for the ride
The habits that stop a bad package getting in at allinspecting a package before you install it, recognising a typosquat, pinning with a lockfile, turning off install-time scripts, and wiring an audit into CI so an old dependency can never slip back in
Before you start
  • Node.js and npm, and Python 3 with uv. The Level 0 lesson Install anything from GitHub covers getting Node and a terminal set up if they are new to you; uv is a fast Python environment manager that this mission installs in one line if you do not have it. No admin rights are needed for uv
  • A terminal. On Windows that is PowerShell, already on your PC; on macOS or Linux your normal terminal. Every command here works the same in all three
  • An internet connection, so the package managers can fetch packages and the audit tools can reach the advisory databases. No GPU, no Docker, no paid account
  • The lab-only mindset the track is built on: you audit and patch projects you own or are responsible for. The companion lesson Read a CVE and reproduce it takes one of these flaws apart in depth and is a natural next step
01/07Why dependencies are the soft underbelly0 done
STEP 01 of 07~5 min

Why dependencies are the soft underbelly

Understand what you are really installing when you run npm install or pip install, and why that inherited code is where most real-world risk now lives, before you audit anything.

  1. When you run npm install or pip install, you are pulling in code other people wrote and running it as part of your project. Each package you ask for is a dependency. But almost none of them stand alone: the package you wanted has its own dependencies, and those have theirs, down several layers. Those deeper ones, the packages you never named but that got installed anyway because something you did name needs them, are your transitive dependencies. A small project that lists three packages can easily end up with a hundred on disk.

  2. That is the whole point of a package ecosystem, and also its risk. You did not write any of that code, you rarely read it, and yet it runs with the same access your own code has. If one package in that tree has a security flaw, or is replaced by a hostile version, the weakness is now yours, whether or not you ever knew the package was there. This is supply-chain security: the chain of trust that runs from your project through every package it depends on, direct or transitive, and every author and build server behind them.

  3. The flaws come in two shapes, and this mission covers both. The first is a known vulnerability: a published, catalogued flaw in a specific version of a real, legitimate package, the kind an audit tool can look up. Each one usually has a CVE id (Common Vulnerabilities and Exposures, a global free catalogue, with ids like CVE-2023-32681) and often an ecosystem-specific advisory id too: a GHSA id for the GitHub advisory, or a PYSEC id for the Python one. An audit tool reads the exact versions you have installed and tells you which carry a known advisory and which version fixes it.

  4. The second shape is a malicious package: code that is harmful on purpose. The most common delivery is a typosquat, a package with a name one keystroke away from a popular one, hoping you mistype or copy a bad instruction. A related trick is dependency confusion, where an attacker publishes a public package with the same name as one of your company's private internal packages, betting your installer will prefer the public one. Step 5 and step 6 are about spotting both before anything runs.

  5. There is one more fact worth knowing up front, because it is why a bad package is so dangerous: installing a package can run code. npm packages may define postinstall and similar scripts that execute automatically the moment you install them, before you have run a single line of your own code. So "I only installed it, I never used it" is not the safety people assume. Step 6 shows how to turn that off.

    TipAuditing your own projects needs no special permission: the code is yours to inspect. The one rule the track is built on still holds in spirit. You scan and patch systems you own or are responsible for, which here means your own projects and the packages they pull in.
✓
CheckpointYou can say, in one sentence, the difference between a dependency you chose and a transitive one, and why a flaw in a package you never named can still be your problem.
Stuck? Ask the community
Next mission · Ethical hackingRun code you do not trust in a safe sandbox
→