Direct and transitive dependencies
A direct dependency is a package your team added on purpose: it is in the manifest (package.json, pom.xml,
.csproj, requirements.txt…). A transitive dependency is a package that one of your dependencies needs, and that
comes along without anyone choosing it.
your-app├── web-framework 4.2 ← direct│ ├── http-parser 1.8 ← transitive│ └── template-engine 3.1 ← transitive│ └── string-utils 0.9 ← transitive (vulnerable)└── logging 2.0 ← directIn a typical application, transitive dependencies outnumber direct ones many times over.
Why it matters
Section titled “Why it matters”- “We don’t use that library” is often wrong: it is there, two or three levels down.
- The vulnerable package may not even appear in your manifest, only in the lock file.
- You usually can’t update a transitive dependency alone: the fix comes by updating the direct dependency that pulls it in, or by overriding its version.
Lock files are the source of truth
Section titled “Lock files are the source of truth”The manifest says what you asked for. The lock file (package-lock.json, yarn.lock, packages.lock.json,
poetry.lock, go.sum…) says what was really installed, transitive dependencies included. Committing it is what makes
builds reproducible and inventories accurate.
In Leavory
Section titled “In Leavory”Packages lists the dependencies of every repository, reading the lock file when there is one, and Exposure shows which of them have confirmed vulnerabilities and the version that fixes them.