Summary
Tekton Pipelines' git resolver improperly handles the pathInRepo parameter, allowing crafted paths to escape the intended repository directory and read arbitrary files from the resolver pod's filesystem.
A tenant who can create ResolutionRequests (directly or via TaskRuns/PipelineRuns using the git resolver) can exfiltrate sensitive files such as ServiceAccount tokens, whose contents are returned base64-encoded in resolutionrequest.status.data.
Affected context
This vulnerability affects Kubernetes environments running Tekton Pipelines where:
- The git resolver is enabled and used to fetch Tasks or Pipelines from Git repositories.
- Tenants are allowed to create
TaskRuns/PipelineRunsorResolutionRequeststhat reference the git resolver. - The resolver pod has access to sensitive files on its filesystem, such as mounted ServiceAccount tokens, configuration files, or secrets.
In such multi-tenant setups, the isolation boundary may be weaker than expected because resolver pods process parameters provided by tenants without adequately constraining filesystem access.
Exploit preconditions
- Attack surface: Tekton git resolver within the Kubernetes cluster.
- Required access: Ability to create
ResolutionRequests, or to createTaskRuns/PipelineRunsthat indirectly createResolutionRequestsusing the git resolver. - Trigger point: Supplying a malicious
pathInRepovalue that includes traversal sequences (e.g.,../) or equivalent constructs when requesting resolution of a remote resource. - Why exploitation is possible: The
pathInRepoparameter is not normalized and constrained to a safe base directory before being used for filesystem access, allowing escape from the expected repository path and access to arbitrary files visible inside the resolver pod.
Why this happens
The core issue is a lack of robust path canonicalization and validation before using user-controlled input as part of a filesystem path.
The git resolver treats the pathInRepo parameter as trusted, concatenating it with a base directory (or otherwise using it directly) without eliminating traversal components or verifying that the final resolved path stays within an allowed directory tree.
This aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where an application fails to enforce directory boundaries, enabling attackers to read files they should not be able to access.
Potential impact
- Unauthorized reading of ServiceAccount token files from the resolver pod.
- Access to cluster credentials that can be used to impersonate the resolver's identity against the Kubernetes API.
- Exposure of configuration files, logs, or secrets mounted into the resolver pod.
- Lateral movement within the cluster using the compromised token or sensitive data.
- Escalation from tenant-level isolation to broader namespace or cluster-level compromise, depending on the permissions associated with the stolen credentials.
General mitigation guidance
Effective mitigation focuses on constraining filesystem access and tightening multi-tenant boundaries:
- Normalize and canonicalize all user-provided paths, rejecting any that resolve outside a predefined, strict base directory for checked-out repositories.
- Use allowlists or exact mappings of valid resource paths instead of passing arbitrary path fragments from users to filesystem APIs.
- Run resolver pods with minimal privileges and limited filesystem visibility (e.g., avoid mounting high-privilege ServiceAccount tokens; use dedicated, least-privilege ServiceAccounts).
- Isolate resolvers used by untrusted or less-trusted tenants into separate namespaces or workloads with strong RBAC boundaries.
- Apply defense-in-depth Kubernetes controls such as read-only root filesystems and restricted volume mounts where practical.
How teams detect issues like this
Teams can detect and monitor for this pattern at both code and operations levels:
- Static analysis & code review:
- Search for direct or indirect use of user-controllable inputs (
pathInRepo, similar path parameters) in filesystem operations without normalization and boundary checks. - Flag path concatenations that do not verify the canonical path remains under a known safe root.
- Enforce secure coding guidelines for path construction and file access through linting rules or code review templates.
- Runtime and logging:
- Log all
ResolutionRequestsand include the requestedpathInRepofor anomaly detection (e.g., presence of../or unusual absolute paths). - Monitor resolver pod logs and audit events for repeated or suspicious resolution failures involving traversal patterns.
- Security tooling:
- Incorporate container security scanners and policy engines (e.g., admission controllers, OPA/Gatekeeper, Kyverno) to enforce that resolver pods run with least privilege and do not mount overly powerful ServiceAccounts.

