Safeguard
Security Guides•

A dependency review checklist for a repo with Go, Rust and C++

A single checklist for pull requests that touch dependencies in Go, Rust or C++: what file changes, what to read, and what each ecosystem can hide.

Safeguard Security Team
3 min read

Review dependency changes by looking at the file that records them, then asking the same four questions in every language: what changed, where did it come from, what runs at build time, and who patches it. The files differ, the questions do not.

Which file to read in each language

LanguageDeclared inResolved and checked inOften missed
Gogo.modgo.sumreplace lines, tool dependencies
RustCargo.tomlCargo.lockgit and path sources, build scripts
C++CMakeLists, Conan or vcpkg filesConan lockfile or vcpkg baselineFetchContent, submodules, vendored copies

For Go, the modules reference explains that the go command hashes each downloaded file and compares it with go.sum, reporting a security error on mismatch. For Rust, a bare version in Cargo.toml is a caret requirement that allows compatible newer releases, so Cargo.lock holds what is actually built. See what a plain version means in Cargo.toml.

The four questions

  1. What changed? List added, removed and bumped packages. In Rust, a preview from cargo update dry run helps. In Go, go list with the update flag shows the gap.
  2. Where did it come from? Look for sources other than the default registry or proxy: a replace line in Go, a git or path source in Rust, a fetched archive or submodule in C++.
  3. What runs at build time? Rust build scripts and procedural macros run code. Go go:generate lines run only when someone calls them, per the go command documentation. C++ builds can run configure scripts and custom commands.
  4. Who patches it? A Go or Rust module is patched by a new release. A C library may be patched by your OS, a package manager, or you. See what a -sys crate means.

Pull request checklist

  • The lockfile or checksum file changed together with the manifest.
  • No new source outside the approved registry, proxy or recipe index.
  • New packages have a clear maintainer and a reason to exist.
  • Native code, whether cgo in Go, a -sys crate in Rust, or a C library, has a named version and owner. See CGO_ENABLED and dependencies.
  • Tests and the advisory check pass on the resolved set.
  • Anything pinned to a branch or a tag moves to a commit.

Automate what you can

Automate the file checks: a CI step that fails when go.mod changes without go.sum, or Cargo.toml without Cargo.lock. Keep the judgement questions for the reviewer.

Where Safeguard fits

Safeguard's dependency scanning, SBOM generation and PR gates cover these ecosystems in one place. The free scan at gold.safeguard.sh/scan is a quick start.

Try it yourself

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

Step through the gate and note which dependency checks would block a merge.

Quick check

Do the same checks work for all three languages?

The four questions do. The files and tools differ by ecosystem.

Which change is most often missed in review?

A source that is not the default registry, such as a Go replace line, a Rust git source, or a C++ fetched archive.

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.