Safeguard
Developer Tools•

How do you review a vendored dependency update in a pull request?

Vendoring puts dependency code in your repo, so every update is a code diff. Here is how to review it without reading every line, for Go and Cargo.

Safeguard Security Team
4 min read

Review a vendored update by checking what changed in the manifest and the vendor listing first, then diffing the vendored files against the upstream release for that version, and finally scanning the result. Vendoring turns an invisible dependency change into a visible diff, which is its main security advantage.

What vendoring means for intake

When dependencies are vendored, a copy of their source sits inside your repository. The Go modules reference explains that with a vendor directory present and a go version of 1.14 or higher in go.mod, the go command acts as if the vendor mode were selected by default, and in that mode it will not use the network or the module cache. Cargo offers a similar path: its source replacement feature can replace crates.io with a vendored directory.

For intake, the consequence is useful. A version change is a pull request with the actual code changes in it. The danger is the opposite one: big diffs get approved without anyone reading them.

A review in four passes

  1. Read the summary files. In Go, that is go.mod and the vendor listing file; in Cargo, the manifest and lockfile. Which packages were added, removed or changed, and by how much?
  2. Check the delta against the upstream release. Confirm that the vendored files for a version match the files published for that version. A mismatch means someone edited vendored code, intentionally or not.
  3. Scan for risky additions. Look for new network calls, process execution, file system writes outside expected paths, and build scripts.
  4. Run the usual policy checks. License, advisories, source and publisher.

Make the diff smaller

TechniqueEffect
One dependency update per pull requestReviewers see one story at a time
Separate the vendor commit from the code that uses itCleaner history
Generated file markersTools can skip files you never edit by hand
An automated comparison jobCompares vendored files with upstream and reports differences

A comparison job

The most valuable automation is a job that re-creates the vendor directory from the manifest in a clean environment, and fails the pull request if the result differs from what was committed. This catches hand edits and partial updates. Run it through your mirror so the sources are the ones you approved.

Handling edited vendored code

Sometimes a team patches a vendored package. That is a fork in practice. Record it: why, who owns it, what the upstream issue is, and a date to revisit. Edited vendored code will not receive upstream fixes automatically, so it needs an owner who watches advisories.

Common mistakes

  • Treating a vendored directory as trusted because it is in your repository. Code in your repository is yours to review.
  • Skipping scanning for vendored code because there is no lockfile to read. Scanners that read the vendor listing or source can still inventory it.
  • Letting generated changes bypass code review rules.

Where Safeguard fits

Safeguard's SBOM and dependency scanning can inventory packages from supported manifests and vendored layouts, and gates can apply policy on the pull request. Try the free scan on a repository.

Quick check

Is vendoring safer than using a mirror?

They solve different problems. Vendoring gives visibility and offline builds, while a mirror gives central control. Many teams use both.

Do vendored dependencies still need scanning?

Yes. Known vulnerabilities in vendored code are just as exploitable.

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.