Node.js Security in Short
Node.js publishes security releases for all supported lines at once, usually announced a week ahead. Only even-numbered lines get long-term support, for about 30 months; odd-numbered lines are short-lived. Flaws in Node.js itself are fewer than in npm packages, but they affect every app on that runtime. Node2Shell was one.
How to Keep Node.js Patched
- Stay on an LTS line and move off it before its end-of-life date.
- Update through your version manager (nvm, fnm, Volta), the NodeSource repository or your base Docker image, then restart the app.
- Rebuild containers. A Docker image keeps the Node.js it was built with until you rebuild it.
- Run
npm audittoo: most risk is in your dependencies, which this page doesn't cover.