Skip to main content

CVE-2026-40161 — Vulnerability in github.com/tektoncd/pipeline

HIGH

Tekton Pipelines: Git resolver API mode leaks system-configured API token to user-controlled serverURL

Published April 21, 2026Updated September 10, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.45%). Schedule for your next planned update.

Does your project use an affected github.com/tektoncd/pipeline version?

Paste your go.sum to check it for CVE-2026-40161 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my go.sum

Summary

Summary

The Tekton Pipelines git resolver in API mode sends the system-configured Git API token to a user-controlled serverURL when the user omits the token parameter. A tenant with TaskRun or PipelineRun create permission can exfiltrate the shared API token (GitHub PAT, GitLab token, etc.) by pointing serverURL to an attacker-controlled endpoint.

Details

The git resolver's ResolveAPIGit() function in pkg/resolution/resolver/git/resolver.go constructs an SCM client using the user-supplied serverURL and a token obtained via getAPIToken().

When the user provides serverURL but omits the token parameter:

  1. getSCMTypeAndServerURL() reads serverURL directly from user params (params[ServerURLParam]) with no validation against the system-configured URL.

  2. secretRef is set to nil because the user did not provide a token parameter.

  3. getAPIToken(ctx, nil, APISecretNameKey) is called. It detects apiSecret == nil, creates a new secretCacheKey, and populates it from the system-configured secret (conf.APISecretName / conf.APISecretNamespace / SYSTEM_NAMESPACE).

  4. clientFunc(scmType, serverURL, string(apiToken)) creates an SCM client pointed at the attacker-controlled URL with the system token. The SCM factory sets the token as an Authorization header on the HTTP client.

  5. All subsequent API calls (Contents.Find, Git.FindCommit) carry the system token to the attacker URL.

Impact

The system Git API token (GitHub PAT, GitLab token, etc.) is exfiltrated to an attacker-controlled endpoint. This token typically has read access to private repositories containing source code, secrets, and CI/CD configurations.

This follows the same threat model as GHSA-j5q5-j9gm-2w5c (published March 2026): a namespace-scoped tenant with permission to create TaskRuns exploits the git resolver to exfiltrate credentials. The prior advisory involved reading the resolver pod's ServiceAccount token via path traversal. This finding involves redirecting the system Git API token via serverURL.

Patches

Fixed in:

  • v1.0.2 (release-v1.0.x branch)
  • v1.3.4 (release-v1.3.x branch)
  • v1.6.2 (release-v1.6.x branch)
  • v1.9.3 (release-v1.9.x branch)
  • v1.11.1 (release-v1.11.x branch)

The fix validates that when serverURL is user-provided and differs from the system-configured server URL, the user must also provide their own token parameter. Using the system token with a non-system server URL is rejected.

Workarounds

  • Do not configure a system-level API token in the git resolver ConfigMap. Instead, require all users to provide their own tokens via the token parameter.
  • Restrict TaskRun creation — limit which users or ServiceAccounts can create TaskRuns and PipelineRuns that use the git resolver.
  • Network egress policies — apply NetworkPolicy to the tekton-pipelines-resolvers namespace to restrict outbound traffic to known-good Git servers only.

Affected Versions

All releases from v1.0.0 through v1.10.0, including all patch releases. The API mode of the git resolver has been present since the resolver was introduced.

Releases prior to v1.0.0 are not affected because the git resolver either did not exist or did not have API mode.

Acknowledgments

This vulnerability was reported by Koda Reef (@kodareef5), who provided a detailed analysis and proof-of-concept. Thank you!

References

  • Prior advisory: GHSA-j5q5-j9gm-2w5c
  • Related: #9608 (deprecate api-token-secret-namespace)
  • Related: #9609 (SubjectAccessReview for resolver secrets)

Advisory Timeline

  • First published April 21, 2026 (219 days ago).
  • Last revised September 10, 2026 — 141 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Go
Update github.com/tektoncd/pipeline to 1.9.3 or later
go get github.com/tektoncd/pipeline@v1.9.3
Go
Update github.com/tektoncd/pipeline to 1.6.2 or later
go get github.com/tektoncd/pipeline@v1.6.2
Go
Update github.com/tektoncd/pipeline to 1.3.4 or later
go get github.com/tektoncd/pipeline@v1.3.4
Go
Update github.com/tektoncd/pipeline to 1.11.1 or later
go get github.com/tektoncd/pipeline@v1.11.1
Go
Update github.com/tektoncd/pipeline to 1.0.2 or later
go get github.com/tektoncd/pipeline@v1.0.2

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (5)

Affects 1 ecosystem: Go (1).

PackageFixed In
github.com/tektoncd/pipeline Go · Affected: All versions1.9.3
github.com/tektoncd/pipeline Go · Affected: All versions1.6.2
github.com/tektoncd/pipeline Go · Affected: All versions1.3.4
github.com/tektoncd/pipeline Go · Affected: All versions1.11.1
github.com/tektoncd/pipeline Go · Affected: All versions1.0.2

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.7 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N

Frequently Asked Questions

What is CVE-2026-40161?
Tekton Pipelines: Git resolver API mode leaks system-configured API token to user-controlled serverURL. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.7/10).
How do I check if my project is affected by CVE-2026-40161?
CVE-2026-40161 affects github.com/tektoncd/pipeline. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-40161 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.7

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
0.45%
EPSS percentile: 30.6

This is a below-median EPSS score — only 30.6% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-wjxp-xrpv-xpff
GO-2026-5711

Related CVEs

  • CVE-2026-33211
    CRITICAL

    Path traversal in Tekton Pipelines git resolver allows reading arbitrary files from the resolver pod

  • CVE-2026-40938
    HIGH

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

  • CVE-2026-108262
    HIGH

    DDEV incomplete tar symlink traversal fix allows host file overwrite - Incomplete fix of CVE-2026-32885

  • CVE-2026-130007
    HIGH

    k8s-mcp-server: Missing authentication on default SSE/HTTP transport allows unauthenticated Kubernetes tool execution

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my go.sum