Arbitrary Argument Injection Affecting github.com/moby/buildkit/source/git package, versions >=0.30.0 <0.31.2


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.2% (11th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-GITHUBCOMMOBYBUILDKITSOURCEGIT-18269092
  • published23 Jul 2026
  • disclosed21 Jul 2026
  • creditssst0n3

Introduced: 21 Jul 2026

CVE-2026-15793  (opens in a new tab)
CWE-88  (opens in a new tab)

How to fix?

Upgrade github.com/moby/buildkit/source/git to version 0.31.2 or higher.

Overview

Affected versions of this package are vulnerable to Arbitrary Argument Injection through gitSourceHandler.checkoutAsBundle in source/git/bundle.go and getDefaultBranch in source/git/source.go. An attacker can trigger crafted host-side git command arguments by supplying a malicious Git repository whose advertised default branch or bundle ref begins with dash-like option text. When git.checkoutbundle=true is used against an attacker-controlled Git source, the code reuses the remote’s advertised ref and passes it to git fetch without protecting it as a positional argument. That lets the attacker influence the git invocation on the build host, breaking the checkout process and enabling execution of unintended Git options during source retrieval.

CVSS Base Scores

version 4.0
version 3.1