Pricing Insights
Book a demo

SCA

SCA: Software Composition Analysis

SCA checks the libraries and dependencies an application is built from. It shows whether the versions in use have known vulnerabilities (CVE) and which licenses cover the code.

Most of the code in a modern application comes from third parties. Your own code can be flawless, yet one vulnerable library such as Log4j exposes the whole system.

How it works

  • Read manifests and lock files: package-lock.json, pom.xml, requirements.txt, go.sum and so on.
  • Build the dependency tree, both direct and transitive (dependencies of dependencies).
  • Match versions against vulnerability databases: NVD, GitHub Advisory, OSV.
  • Check licenses and produce an SBOM, the list of all components.

What it finds

Known vulnerabilities in library versionsCVElog4j-core 2.14.1 → CVE-2021-44228
Vulnerabilities that are already exploitedKEVListed in the CISA KEV catalog: fix these first
License risksGPL, AGPLA copyleft license in a closed-source product
Malicious packagesMALTyposquatting and hijacked packages in npm and PyPI
Outdated and abandoned components—Versions with no support and no fixes

Example

Vulnerable: pom.xml
<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-core</artifactId>
  <version>2.14.1</version>
</dependency>
Fixed: a version without the known Log4Shell vulnerabilities
<dependency>
  <groupId>org.apache.logging.log4j</groupId>
  <artifactId>log4j-core</artifactId>
  <version>2.17.1</version>
</dependency>
What it looks like in a report

CVE-2021-44228 (Log4Shell) · CVSS 10.0 · in the CISA KEV catalog · log4j-core 2.14.1 was fixed in 2.15.0. Taking CVE-2021-45046, -45105 and -44832 into account, update to 2.17.1 (Java 8+). The library often arrives transitively, through another package.

Limitations and common mistakes

  • It only knows about published vulnerabilities and will not find a zero-day.
  • Not every vulnerability in a library is reachable from your code. Without reachability analysis the list can be long.
  • Updating a library is not always simple. You need a strategy: update, replace, cover with a compensating control or accept the risk.

How to choose an SCA tool

  1. Ecosystems and lock files of the project: Maven and Gradle, npm and yarn, pip and poetry, NuGet, Go modules. Transitive dependencies must be covered, not only direct ones.
  2. Vulnerability databases and how fast they update: NVD, GitHub Advisory, OSV. For an isolated network, an offline mirror of the database.
  3. Prioritization: CVSS, EPSS, the KEV flag and reachability of the vulnerable function from your code.
  4. Licenses: a policy of allowed and forbidden licenses, not just a list.
  5. SBOM in CycloneDX or SPDX format, for tracking dependencies and for accepting software from contractors.
  6. Policies and quality gate: a build with a critical vulnerability and no exception does not move forward.

SAST, SCA and DAST: what is the difference

SASTSCADAST
What it checksYour own source codeThird-party librariesThe running application from outside
Needs a runNoNoYes, a test environment
WhenEvery merge requestEvery build and on a new CVEOn a test environment before release
FindsInjections, XSS, secrets, weak cryptographyKnown CVEs, licenses, malicious packagesConfiguration, authentication and header errors
Does not seeOther people's libraries, server configurationErrors in your codeThe exact place in the code

Tools

OWASP Dependency-CheckOWASP Dependency-TrackTrivyGrypeOSV-ScannerGitHub Dependabot

Questions and answers

What is a transitive dependency?

A library you did not add yourself, pulled in by another library. Vulnerable versions most often hide in transitive dependencies.

How is SCA different from SAST?

SAST checks your code and SCA checks the third-party code you use. For a full picture you need both.

What is SCA in simple terms?

A check of the application's composition: which third-party libraries it is built from, whether their versions have known vulnerabilities and whether their licenses are acceptable.

How are SCA and SBOM related?

An SBOM lists all components and versions. SCA builds it from manifests and lock files and compares it with vulnerability databases. When a new CVE appears, the SBOM shows at once which applications are affected.

Does SCA work in an isolated network without internet?

Yes, if the vulnerability databases are updated from a local mirror. Without updates SCA goes stale quickly, because new CVEs are published every day.

Will SCA find a malicious package?

If the package is already in the databases (GitHub Advisory entries of type malware, OSV entries with MAL identifiers), yes. Fresh typosquatting appears before the database record does, so pinned versions, lock files and an internal proxy repository also help.

SCA in TRAIO →