Lesson 06 of 7 · DevSecOps for IT professionals and developers
Review dependency findings and updates
Trace direct and transitive dependencies, assess a vulnerability finding in context, and validate a narrow, reviewed update.
Lesson objective
By the end, you can
Given a project manifest, lockfile path, and vulnerability finding, distinguish direct from transitive dependencies, compare the installed version with the affected range, assess remediation and project context, and plan a narrow update with review, relevant checks, and a follow-up scan.
Practical instruction
Trace the finding before changing the dependency graph
Separate direct and transitive dependencies
A direct dependency is declared by your project in its manifest, such as package.json. A transitive dependency is installed because one of those direct dependencies requires it, or because another package below it requires it. Transitive packages still become part of the software you ship, even though your team did not list them in the top-level manifest.
Use the lockfile or your package manager’s dependency-tree command to follow the path from the project to the package named in a finding. Check whether the package is direct or transitive, which parent brings it in, and whether it is present in the runtime, build, or test dependency graph. Do not dismiss a finding only because the package is transitive or absent from the top-level manifest.
Verify what the finding says about the installed version
Confirm the exact package and installed version from the lockfile, then compare that version with the advisory’s affected range and fixed versions. A package name alone is not enough: the installed version may be outside the affected range, while a seemingly small version difference may still fall inside it. Read the scanner’s source and confidence details when available, and record any uncertainty for review.
Read the remediation notes and project context before choosing a response. Check whether the vulnerable code path is used or reachable, whether the package is included in production or only in development tooling, what the advisory says about impact and prerequisites, and whether a fixed release changes behavior or has known compatibility concerns. Context helps prioritize and test a finding; it does not make an affected package safe by itself.
Choose a narrow update and inspect both files
Prefer the smallest supported update that moves the affected package to a fixed version and fits the project’s compatibility needs. For a transitive finding, first check whether the direct parent has a suitable release that brings in the fix. Change only the necessary direct dependency or use the package manager’s documented override mechanism when the parent cannot yet be updated and the override is compatible. Avoid updating every dependency blindly or forcing an unreviewed version.
Review the manifest and lockfile diff together. Confirm the intended direct dependency constraint changed, the lockfile resolves the affected package to a fixed version, and unrelated packages did not move unexpectedly. Read release notes for the selected version and follow the project’s normal dependency review and approval process before merging.
Validate the change and rescan
Run the checks that cover the affected package and its consumers, such as focused unit or integration tests, the relevant build, and any package-specific compatibility checks. Review failures rather than skipping them to make the update appear complete. Keep the change open for review if the fix breaks expected behavior or its scope is unclear.
After the update and checks, scan the resolved dependency graph again. Verify that the original finding no longer applies to the installed version and review any new or remaining findings. Record the package path, version change, checks, and scan result so another maintainer can reproduce the decision. A completed update is a reviewed and validated change, not merely a clean-looking manifest edit.
Safe hands-on exercise
Review a fictional dependency finding
Harbor Notes API is a fictional training project. The manifest, lockfile path, finding, package versions, and remediation note below are invented for this exercise; none describes a real package, advisory, scan, or product. Use only these sample records.
FICTIONAL EXERCISE RECORDS ONLY — no real package or advisory
Project: Harbor Notes API (fictional)
package.json direct dependencies:
{ "@training/checkout-api": "2.4.1", "@training/metrics-lite": "1.2.0" }
lockfile dependency path:
Harbor Notes API → @training/checkout-api@2.4.1 → url-reader@1.2.0
Sample finding FICTIONAL-ADV-01:
package: url-reader | installed: 1.2.0 | affected range: <1.3.4
fictional remediation note: @training/checkout-api@2.4.3 resolves url-reader@1.3.4Apply the lesson
Select the steps a maintainer should take to classify the packages, review this sample finding, and make a careful update. Reject shortcuts that skip dependency tracing, compatibility review, validation, or rescanning.
A complete review identifies all five required steps and rejects unsafe recommendations. The sample is static teaching data; this check runs only in your browser. The project, package names, versions, affected range, advisory, and remediation note are fictional. Do not treat them as real security evidence.
Knowledge check
Check your understanding
A scan reports an installed transitive package inside an affected version range. Which response best verifies and remediates the finding?