Tracking vulnerabilities in dependencies and handling end-of-life (EOL) components

  1. Introduction
  2. Step 1: know what you use
  3. Step 2: know which vulnerabilities are published
  4. Step 3: triage first, then patch
  5. End-of-life (EOL) components
  6. Habits worth having
  7. Summary
  8. References

Introduction

When you run npm install or pip install, you pull in not only the library you chose but the whole chain of libraries it needs, called transitive dependencies.

Even a small project can pull in hundreds of packages. When one of them has a vulnerability, your application is affected even though you never wrote a line of related code.

The OWASP Top 10 has a whole category for this problem: A06:2021 Vulnerable and Outdated Components.

This article explains how to track library vulnerabilities and what to do when a component is no longer supported.

It is the SCA (software composition analysis) step mentioned in the article on the secure software development lifecycle.

Step 1: know what you use

You cannot patch what you do not know you have. The first source of truth is the version-locking files (lockfiles) such as package-lock.json or a pinned requirements.txt.

Commit them to the repository and use them for reproducible installs, for example npm ci instead of npm install in CI.

A more standardized form of inventory is an SBOM (Software Bill of Materials): a file listing components, their versions and their origin. Two common formats are CycloneDX and SPDX.

An SBOM is useful because when a new vulnerability is announced, you look up the inventory and answer within minutes the question "do we use that component, at which version, in which product?".

Do not forget components beyond language libraries: base container images, operating system packages, runtimes (Node.js, Python, the JVM) and bundled databases and web servers.

Step 2: know which vulnerabilities are published

Publicly disclosed vulnerabilities usually have a CVE (Common Vulnerabilities and Exposures) identifier and sit in advisory databases.

You do not need to look them up by hand; tools match the versions you use against these databases:

npm audit                      # full report
npm audit --omit=dev           # only runtime dependencies, skipping development-only ones
npm audit --audit-level=high   # fail (non-zero exit code) only for high severity or above

The --audit-level option is handy for setting a gate in CI: the build turns red only when a vulnerability is serious enough.

Read npm audit --help for the npm version you have installed, because options can differ between releases.

version: 2
updates:
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "weekly"

Whichever tool you use, put the results where the responsible person will actually see them: the team's alert channel, a task list, or a blocking step in CI.

Step 3: triage first, then patch

Not every alert is equally urgent. A report can have dozens of entries, and if everything is "red", the team will ignore everything. A reasonable way to triage:

Is the vulnerable code actually used?

A vulnerability in a function the application never calls, or in a package used only during development, usually carries lower risk.

Can it be exploited from outside?

A component on the path that handles user-submitted data has higher priority than one that runs internally.

Severity

(usually the CVSS score in the advisory) plus whether public exploit information exists.

Is there a fix?

If so, upgrade the version. If not, look at the mitigations the author's advisory lists (disable a feature, change a setting, block at an application firewall).

When upgrading, prefer patch releases first, as they are less likely to break things than major releases.

Always run the test suite after upgrading, and record the decision for items deliberately left unresolved, with an owner and a review date.

End-of-life (EOL) components

EOL (End of Life) is the point from which the developer stops releasing patches, including security patches.

EOL components are especially dangerous because when a new vulnerability is found there will be no official fix, while attackers can still exploit it.

A few useful things to know:

Once you find an EOL or soon-to-be-EOL component, the options, in the usual order of preference, are:

Upgrade

to a version that is still supported.

Replace

it with another library that is still maintained, if the original project has been abandoned.

Buy extended support

from the vendor, if available (for example ESM for operating system packages).

Mitigate temporarily

isolate the component (separate network, least privilege), monitor it closely, and record the risk in the risk register with a clear deadline. This is only a stopgap, not a solution.

Forking and patching an EOL library yourself should be a last resort, because you take on security maintenance that the whole community would normally do.

Habits worth having

Summary

Dependencies are part of your code in terms of risk, even though you did not write them. Take inventory, scan regularly, triage alerts with reasoning and update in small steps.

For EOL components, do not wait for an incident: record the end-of-support date in the inventory, plan an upgrade or replacement early and assign an owner to every exception.

References

Tracking vulnerabilities in dependencies and handling end-of-life (EOL) components