A typical Node.js or Python web application ships far more third-party code than code its own team wrote, and most of that code was never reviewed by anyone on the payroll. Software composition analysis (SCA) is how teams inventory their open source dependencies, check them against known vulnerabilities and licence obligations, and decide what actually needs fixing. This article covers what SCA inspects, where it falls short, how to triage its output without drowning in it, and how to set up a workflow that still works six months later.
What Software Composition Analysis Actually Inspects
SCA tools start with manifests and lockfiles: package-lock.json, yarn.lock, poetry.lock, composer.lock, go.sum, pom.xml. From these they resolve the full dependency tree, including packages pulled in by your packages. Each resolved name and version is then matched against vulnerability databases such as the NVD, the GitHub Advisory Database and OSV.dev.
Container-aware scanners like Trivy and Grype go a layer deeper and inspect OS packages inside image layers. This matters because a clean application lockfile says nothing about the outdated OpenSSL or glibc in your base image. Most tools can also export a software bill of materials (SBOM) in CycloneDX or SPDX format, which becomes the basis for everything else.
Why Transitive Dependencies Carry Most of the Risk
Few teams affected by Log4Shell (CVE-2021-44228) in December 2021 had log4j-core listed as a direct dependency. It arrived through frameworks, search engines and vendor SDKs, sometimes four or five levels deep. Teams with an SBOM answered “are we affected?” in minutes. Teams without one spent days grepping JAR files.
Equifax’s 2017 breach followed the same pattern from a different angle. The Apache Struts flaw (CVE-2017-5638) had a public fix in March, and attackers got in roughly two months later. The vulnerable component was known and the patch existed. What was missing was knowing exactly where that component was running.
A Realistic Triage Scenario
Take an Express application with 38 direct dependencies and around 1,100 entries in its lockfile. The first npm audit run returns 47 advisories, 9 high and 2 critical. A junior developer’s instinct is to run npm audit fix –force, which quietly applies major version bumps and breaks the build.
An experienced application security engineer first separates runtime from tooling. Running npm audit –omit=dev drops the count to 14, because both criticals sit inside a test runner’s dependency chain and never reach production. Next comes reachability: a prototype pollution advisory in a utility library only matters if the vulnerable function is called with user-controlled input.
Severity scores alone mislead here. A CVSS 9.8 in an unreachable code path matters less than a 6.5 in your request parser. Understanding how CVSS scores work helps, but mature teams add two more signals: the EPSS probability score from FIRST and whether the CVE appears in CISA’s Known Exploited Vulnerabilities catalog. Anything in KEV that ships to production gets fixed this sprint. The rest is queued by exposure.
The Myth That a Clean Report Means Safe Dependencies
The most persistent misconception is that zero SCA findings means the dependency tree is safe. SCA matches known advisories. Malicious code rarely has a CVE on the day it ships.
The 2018 event-stream incident is the textbook case. A new maintainer added a dependency called flatmap-stream that carried code aimed at stealing from a specific Bitcoin wallet application, and it sat in millions of weekly downloads with no advisory attached. The xz utils backdoor (CVE-2024-3094) in versions 5.6.0 and 5.6.1 was found in March 2024 because an engineer noticed odd SSH latency, not because a scanner flagged it. These supply chain attacks through compromised dependencies need controls that sit next to SCA, not inside it.
The reverse myth causes just as much damage: assuming every flagged CVE is exploitable. That belief produces alert fatigue, and the team ends up ignoring the one finding that matters. OSV now includes malicious package records with MAL- identifiers, and some scanners consume them, which narrows the gap without closing it. Package registry tricks like dependency confusion also need registry-level configuration, such as scoped packages and pinned private registries, rather than scanning alone.
Setting Up an SCA Workflow Step by Step
A workflow that survives contact with a real backlog usually looks like this:
1. Generate a CycloneDX SBOM on every production build with Syft or cdxgen, and store it alongside the release artifact.
2. Gate CI only on new findings, using a baseline, and fail builds for critical or KEV-listed issues in runtime dependencies.
3. Automate updates with Dependabot or Renovate, grouping minor and patch bumps weekly so reviewers see 3-5 PRs instead of 40.
4. Re-scan stored SBOMs daily against fresh advisory data, because new CVEs get published against code you shipped months ago.
5. Record every accepted risk with an owner and an expiry date, ideally as a VEX statement.
Step 4 is the one most teams skip. A build-time scan from March tells you nothing about a CVE disclosed in October against the same version still running in production.
Common Mistakes Practitioners Make
Scanning only manifests. Vendored code is invisible to lockfile-based SCA. A copy of jquery-1.12.4.min.js dropped into /static/ years ago, or a WordPress plugin bundling its own outdated library, will never appear in npm audit. jQuery releases before 3.5.0 have well-documented XSS issues, and hand-copied copies of them still turn up regularly in production. File-hash and signature-based scanning, or runtime website scanning, catches what manifests miss.
Permanent suppressions. A finding marked “not exploitable” in 2023 may become exploitable after a refactor exposes the vulnerable function. Suppressions without expiry dates quietly turn into blind spots.
Measuring PR throughput instead of exposure. Merging 200 Dependabot PRs a quarter looks productive. If the KEV-listed issue in your authentication library is still open after 60 days, the metric is lying to you. Track mean time to remediate for exploitable, production-reachable findings and ignore raw counts.
Edge Cases: Air-Gapped, Regulated and Small Teams
Air-gapped and on-prem environments cannot query OSV or the GitHub Advisory Database live. Trivy and Grype both support offline databases, but someone has to own the weekly transfer through a controlled channel. A mirror that’s three months stale is worse than useless, because it produces clean reports that people trust.
Regulated industries face hard requirements. The FDA has required SBOMs for premarket submissions of networked medical devices since 2023. Under the EU Cyber Resilience Act, vulnerability reporting obligations have applied since 11 September 2026: manufacturers must send an early warning about actively exploited vulnerabilities within 24 hours, with full obligations following in December 2027. For these organisations SCA output is compliance evidence, so it must be reproducible and archived.
Teams under 10 people rarely need a commercial platform. Dependabot, osv-scanner and Trivy cost nothing and cover the essentials. The scarce resource is triage time, so strict CI gating on KEV-listed and critical runtime issues matters more than tool choice.
FAQ
How is software composition analysis different from SAST?
SAST analyses the code your team wrote for flaws like SQL injection. SCA identifies third-party components and their known vulnerabilities and licences. The two overlap very little, so most teams need both.
How often should open source dependencies be scanned?
Scan on every build, and re-check deployed SBOMs at least daily against updated advisory data. New disclosures, not code changes, are what create most new findings.
Does SCA cover licence compliance?
Most SCA tools flag licences such as GPL-3.0 and AGPL-3.0, which can impose source disclosure obligations on distributed or network-facing software. Licence detection is reliable for declared metadata. It’s less reliable for code copied into a project without its licence file.
Keeping the Dependency Tree Honest
Software composition analysis works when it answers three questions quickly: what are we running, which of it is exploitable in our context, and who owns the fix. Generate SBOMs, re-scan them continuously, rank findings by reachability and real-world exploitation rather than raw CVSS, and remember that a clean report covers known advisories only. Start by finding vendored files outside your package manager. That’s usually where the oldest and most exploitable code is.
