Safeguard
Security Guides•

System library or bundled copy: which is easier to keep patched in C?

Distributions backport fixes to system libraries, while a bundled copy waits for you. A decision guide for choosing between them in a C or C++ product.

Safeguard Security Team
3 min read

A system library is usually easier to keep patched, because the distribution's security team backports fixes and you receive them through normal updates. A bundled copy gives you control over the exact version but makes you the maintainer. Choose by how fast you can rebuild and how much version control you need.

How distributions handle fixes

Debian's security FAQ explains the approach. Moving to a new upstream version is generally not considered a good solution for security fixes. Instead, the relevant changes are backported, so the release keeps the behaviour it had. The FAQ also says backporting is not always possible, and in those cases a new upstream version may be needed after coordination with the security team.

One consequence is that a higher or lower version number does not tell you whether a fix is present. A stable package can keep its original upstream version and still contain the patch. The FAQ suggests checking the package changelog or comparing your exact version with the one named in the advisory.

What you get with each choice

FactorSystem libraryBundled copy
Who writes the fixDistribution security team, often as a backportYou, or upstream, through a version bump
How it reaches youPackage update on each targetYour own rebuild and release
Version consistency across targetsVaries by distribution and releaseIdentical everywhere
Visibility in an inventoryPackage list on the host or imageOnly if you record it
Time to fix after an advisoryDepends on the distributionDepends on your pipeline

When each choice fits

Prefer the system library when:

  • You target distributions with active security support.
  • Your product runs in an environment you rebuild or update regularly.
  • You do not depend on a recent feature or a specific behaviour.

Prefer a bundled copy when:

  • You target platforms with no reliable package source, or you ship to customers who control the host.
  • You need the same version everywhere for testing or compliance.
  • You have a build pipeline that can rebuild and release quickly.

If you bundle

You take on the work distributions do for you:

  1. Subscribe to the library's advisories and watch for fixes.
  2. Pin the version and record it, with its origin, in your SBOM.
  3. Keep a fast path from advisory to release, with tests.
  4. Track patches you apply, so an upgrade does not drop them.
  5. Set a review date, since pinned code ages quietly.

If you use the system library

  1. Declare the minimum version you require, and say which distributions you support.
  2. Build container images on a schedule so updates land.
  3. Read the distribution's own record of the issue rather than relying only on the upstream version number.
  4. Restart services after updates, since running processes keep old code.

Quick check

Is a lower version number a sign of an unpatched library?

Not necessarily. Distributions backport fixes, so check the package changelog or the distribution's advisory.

Can I mix both?

Yes, for example a bundled copy of one library and system copies of others. Record which is which.

Safeguard's SBOM and dependency scanning can build an inventory of the components in a repository, and the free scan at gold.safeguard.sh/scan is a quick way to see what turns up.

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.