Dependency and security maintenance
Prerequisite: node-capacity-economics. Objective: Triage a fictional advisory. Each example is independent. Use Node.js 22.16.0 in a disposable directory; save as main.mjs and run node main.mjs. No external service is contacted.
How it works
Maintain a lockfile and dependency inventory. Read official advisories, determine whether the installed version is affected, identify exposure and available mitigations, then choose a supported patched version. Review transitive changes and test the resulting artifact. A clean vulnerability scan cannot prove absence of flaws, and an advisory match does not by itself establish exploitability. The examples model fictional review records; they do not scan packages or identify actual vulnerable releases.
Classify fictional review status
function triage({affected,reachable}){if(affected===null)return 'investigate';if(!affected)return 'not affected';return reachable?'prioritize':'review mitigation';}console.log(triage({affected:true,reachable:true}),triage({affected:null}));Expected output:
prioritize investigateUnknown affected status requires investigation rather than automatic clearance.
Gate an update
const release={supported:true,patched:true,tests:true,lockReview:false};console.log(Object.values(release).every(x=>x===true));Expected output:
falseThis fictional gate requires lockfile review even after tests pass.
Common mistake
Do not indiscriminately force dependency updates or treat a scanner report as complete proof of safety.
Practice
Prepare a fictional advisory record with affected ranges, evidence, owner, mitigation and retest criteria; keep unknown values explicit.
Reference candidate: node-dependency-and-security-maintenance-lookup (route unverified). Original instructional model; independent source review pending.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Dependency and security maintenance — knowledge check
Apply the lesson to a fresh scenario and explain the evidence boundary.
What should an unknown affected range trigger?
What should be reviewed after updating a dependency?
What does a clean scan guarantee?