{"id":"CVE-2026-40161","aliases":["CVE-2026-40161","GHSA-wjxp-xrpv-xpff","GO-2026-5711"],"related":[],"kind":"vulnerability","state":"published","title":"Tekton Pipelines: Git resolver API mode leaks system-configured API token to user-controlled serverURL","summary":"Tekton Pipelines project provides k8s-style resources for declaring CI/CD-style pipelines. Starting in version 1.0.0 and prior to versions 1.0.2, 1.3.4, 1.6.2, 1.9.3, and 1.11.1, 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. Versions 1.0.2, 1.3.4, 1.6.2, 1.9.3, and 1.11.1 fix the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Tekton Pipelines project provides k8s-style resources for declaring CI/CD-style pipelines. Starting in version 1.0.0 and prior to versions 1.0.2, 1.3.4, 1.6.2, 1.9.3, and 1.11.1, 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. Versions 1.0.2, 1.3.4, 1.6.2, 1.9.3, and 1.11.1 fix the issue.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe 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.\n\n### Details\n\nThe 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()`.\n\nWhen the user provides `serverURL` but omits the `token` parameter:\n\n1. `getSCMTypeAndServerURL()` reads `serverURL` directly from user params (`params[ServerURLParam]`) with no validation against the system-configured URL.\n\n2. `secretRef` is set to `nil` because the user did not provide a token parameter.\n\n3. `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`).\n\n4. `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.\n\n5. All subsequent API calls (`Contents.Find`, `Git.FindCommit`) carry the system token to the attacker URL.\n\n### Impact\n\nThe 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.\n\nThis 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`.\n\n### Patches\n\nFixed in:\n\n- v1.0.2 (release-v1.0.x branch)\n- v1.3.4 (release-v1.3.x branch)\n- v1.6.2 (release-v1.6.x branch)\n- v1.9.3 (release-v1.9.x branch)\n- v1.11.1 (release-v1.11.x branch)\n\nThe 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.\n\n### Workarounds\n\n- **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.\n- **Restrict TaskRun creation** — limit which users or ServiceAccounts can create TaskRuns and PipelineRuns that use the git resolver.\n- **Network egress policies** — apply `NetworkPolicy` to the `tekton-pipelines-resolvers` namespace to restrict outbound traffic to known-good Git servers only.\n\n### Affected Versions\n\nAll 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.\n\nReleases prior to v1.0.0 are not affected because the git resolver either did not exist or did not have API mode.\n\n### Acknowledgments\n\nThis vulnerability was reported by Koda Reef (@kodareef5), who provided a detailed analysis and proof-of-concept. Thank you!\n\n### References\n\n- Prior advisory: [GHSA-j5q5-j9gm-2w5c](https://github.com/tektoncd/pipeline/security/advisories/GHSA-j5q5-j9gm-2w5c)\n- Related: #9608 (deprecate `api-token-secret-namespace`)\n- Related: #9609 (SubjectAccessReview for resolver secrets)","format":"markdown","source":"ghsa"},{"lang":"en","text":"Tekton Pipelines git resolver leaks API token to user-controlled serverURL in github.com/tektoncd/pipeline","format":"markdown","source":"go"},{"lang":"es","text":"El proyecto Tekton Pipelines proporciona recursos estilo k8s para declarar pipelines estilo CI/CD. Desde la versión 1.0.0 hasta la 1.10.0, el resolvedor git de Tekton Pipelines en modo API envía el token API de Git configurado por el sistema a una serverURL controlada por el usuario cuando el usuario omite el parámetro de token. Un inquilino con permiso de creación de TaskRun o PipelineRun puede exfiltrar el token API compartido (PAT de GitHub, token de GitLab, etc.) al apuntar la serverURL a un endpoint controlado por un atacante.","source":"nvd"}],"published":"2026-04-21T16:26:27.381Z","modified":"2026-10-26T21:10:00.170Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N","score":7.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N","score":7.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N","score":7.7,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-201"],"affected":[{"ranges":[{"version":">= 1.0.0, < 1.0.2","status":"affected"},{"version":">= 1.2.0, < 1.3.4","status":"affected"},{"version":">= 1.4.0, < 1.6.2","status":"affected"},{"version":">= 1.7.0, < 1.9.3","status":"affected"},{"version":">= 1.10.0, < 1.11.1","status":"affected"}],"vendor":"tektoncd","product":"pipeline","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"1.0.0","status":"affected","fixed":"1.0.2"}],"ecosystem":"Go","package":"github.com/tektoncd/pipeline","purl":"pkg:golang/github.com/tektoncd/pipeline","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.2.0","status":"affected","fixed":"1.3.4"}],"ecosystem":"Go","package":"github.com/tektoncd/pipeline","purl":"pkg:golang/github.com/tektoncd/pipeline","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.4.0","status":"affected","fixed":"1.6.2"}],"ecosystem":"Go","package":"github.com/tektoncd/pipeline","purl":"pkg:golang/github.com/tektoncd/pipeline","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.7.0","status":"affected","fixed":"1.9.3"}],"ecosystem":"Go","package":"github.com/tektoncd/pipeline","purl":"pkg:golang/github.com/tektoncd/pipeline","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.10.0","status":"affected","fixed":"1.11.1"}],"ecosystem":"Go","package":"github.com/tektoncd/pipeline","purl":"pkg:golang/github.com/tektoncd/pipeline","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.0.0","status":"affected","fixed":"1.0.2"},{"type":"semver","introduced":"1.1.0","status":"affected","fixed":"1.3.4"},{"type":"semver","introduced":"1.4.0","status":"affected","fixed":"1.6.2"},{"type":"semver","introduced":"1.7.0","status":"affected","fixed":"1.9.3"},{"type":"semver","introduced":"1.10.0","status":"affected","fixed":"1.11.1"}],"ecosystem":"Go","package":"github.com/tektoncd/pipeline","purl":"pkg:golang/github.com/tektoncd/pipeline","source":"go"},{"ranges":[{"status":"affected","introduced":"1.0.0","lastAffected":"1.10.0"}],"vendor":"linuxfoundation","product":"tekton_pipelines","cpe":"cpe:2.3:a:linuxfoundation:tekton_pipelines:*:*:*:*:*:go:*:*","source":"nvd"}],"references":[{"url":"https://github.com/tektoncd/pipeline/security/advisories/GHSA-wjxp-xrpv-xpff","tags":["advisory","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/tektoncd/pipeline/issues/9608","tags":["issue-tracking","report","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/tektoncd/pipeline/issues/9609","tags":["issue-tracking","report","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40161","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/tektoncd/pipeline","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-04-21T17:41:32.164Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40161","url":"https://www.cve.org/CVERecord?id=CVE-2026-40161","licence":"CVE Terms of Use","modified":"2026-05-21T21:20:13.227Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-wjxp-xrpv-xpff","url":"https://github.com/advisories/GHSA-wjxp-xrpv-xpff","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:03.718Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5711","url":"https://pkg.go.dev/vuln/GO-2026-5711","licence":"CC-BY-4.0","modified":"2026-07-23T19:00:13.118Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40161","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40161","licence":"Public domain","modified":"2026-10-26T21:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:19.115Z","epss":{"score":0.0027,"percentile":0.2058,"date":"2026-12-01T12:00:22.000Z"}}