Safeguard
Security Guides•

How do scanners find vulnerable C and C++ libraries?

C and C++ have no single package manager, so detection leans on lockfiles, commit data and version guessing. What that means for scan accuracy.

Safeguard Security Team
3 min read

Without a central package manager, scanners find C and C++ dependencies through a lockfile where one exists, or through commit level data for submodules and vendored copies. Coverage is real but less complete than for npm or PyPI, so treat a clean C or C++ result with more caution.

Why C and C++ are different

Most ecosystems have a registry and a manifest that names every dependency and version. C and C++ projects often copy a library into the tree or pull it in as a Git submodule. The dependency exists, but no file says "this is version 1.2.3".

The OSV-Scanner documentation states this directly: C and C++ have no central package manager, so dependencies are usually bundled, and its support is based on commit level data.

The three routes a scanner can take

SituationWhat a scanner can useConfidence
Conan lockfile presentPackage names and versions from conan.lockHigh
Git submoduleThe commit hash from Git historyGood, if the commit is in the data
Vendored copy with no historyAn estimate of version and commit from file contentsLower, best effort

For submodules, the OSV-Scanner docs say to run a submodule update and then scan the folder. For vendored code they say it uses OSV's determineversion API to estimate the version and commit.

The limits to write down

The same documentation warns that vulnerabilities in C and C++ dependencies "could be excluded" from results because commit level data does not cover everything. That is an honest statement of a coverage gap, and it applies to the approach in general, not just one tool.

Two practical limits follow:

  • A vendored library that was edited, trimmed or renamed may not match the fingerprint.
  • A library installed by the operating system is covered by the distribution's data instead, which is a different route. See why Linux scans track source package names.

How to test coverage on your project

  1. List every third party library in your tree by hand, including vendored folders. This is your ground truth.
  2. Run your scanner and list the components it reports.
  3. Mark each hand listed library as found, found with a wrong version, or missing.
  4. For missing ones, check whether a lockfile or a submodule would make them findable.
  5. Record the gaps in your coverage matrix and decide who reviews those libraries manually.

Where you can, adopt a lockfile such as Conan's, because a resolved list beats an estimate.

Safeguard's SBOM and dependency scanning builds a component inventory, and the free scan at https://gold.safeguard.sh/scan shows what it detects in a manifest you upload.

Try it yourself

Open the demo and notice how each component lists a source for its version. Imagine which of yours would be missing.

Click through it at your own pace, or open it full screen.

Quick check

Can a scanner read versions of vendored C libraries?

Sometimes. Tools may estimate the version and commit from file contents, but the documentation calls this best effort.

What improves C and C++ scan accuracy most?

A resolved lockfile or a Git submodule with history, since both give the scanner a concrete version or commit.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.