🇰🇷 한글 설명
Tekton Pipelines 0.35.0 버전부터 파이프라인이 자식 UID를 검증하지 않는 취약점이 발견되었습니다. 공격자가 TaskRun 생성 권한을 가질 경우, 동일한 이름과 소유자 참조를 가진 가짜 TaskRun을 생성하여 파이프라인 컨트롤러를 속일 수 있습니다. 이는 파이프라인 설정을 런타임에 수정할 수 있게 하여 SLSA L2 보안 요구사항을 위반할 수 있습니다.
💡 쉬운 설명
파이프라인이 실행될 때 자식 작업이 진짜인지 확인하는 과정에서 이름만 확인하고 고유 번호(UID)를 확인하지 않는 문제입니다. 이를 통해 공격자가 가짜 작업을 끼워 넣어 파이프라인의 동작을 조작할 수 있습니다.
🇺🇸 원문 (English)
Tekton Pipelines project provides k8s-style resources for declaring CI/CD-style pipelines. Starting in version 0.35.0, 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. While the software stores and validates the PipelineRun's (api version, kind, name, uid) in the child Run's OwnerReference, it only store (api version, kind, name) in the 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. This issue 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 one Tekton setup. If users already have unrestricted access to create any Task/PipelineRun, this does not grant any additional capabilities. As of time of publication, there are no known patches for this issue.
📍 영향받는 시스템
Tekton Pipelines 0.35.0 이상 버전
⚔️ 공격 벡터
TaskRun 생성 권한을 이용해 기존 파이프라인과 이름 및 소유자 참조가 일치하는 가짜 TaskRun을 생성하여 주입
🛡️ 대응 방법
공식 패치가 발표될 때까지 TaskRun 생성 권한에 대한 RBAC(역할 기반 액세스 제어)를 엄격히 제한하십시오.
🔧 검증 코드
출력된 PipelineRun의 ChildStatusReference에 포함된 정보가 실제 Pipeline의 UID와 일치하는지 확인하여 검증합니다.
kubectl get pipelines.tekton.dev -o jsonpath='{.items[*].metadata.name}' | xargs -I {} kubectl get pipelineruns.tekton.dev --field-selector spec.pipelineRef.name={} -o json | jq '.items[].metadata.uid'