Summary
OpenShift Pipelines-as-Code (PAC) does not check whether the creator of a Repository custom resource is authorized to create PipelineRuns. A namespace user with permission to create and delete Repository and Secret resources may be able to trigger attacker-controlled PipelineRuns that run with the auto-provisioned pipeline ServiceAccount's permissions.
Affected context
The issue occurs in PAC when it processes a Repository custom resource without verifying that its creator may create PipelineRuns. It becomes risky when a namespace user can create and delete Repository and Secret resources, and the auto-provisioned pipeline ServiceAccount has broad permissions, such as the default ClusterRole/edit binding described.
Exploit preconditions
- Attack surface: PAC processing Repository custom resources in a CI/CD namespace
- Required access: Permission to create and delete Repository and Secret resources in the namespace
- Trigger point: PAC handles a Repository resource and runs an associated PipelineRun
- Why exploitation is possible: PAC does not verify that the Repository creator is authorized to create PipelineRuns, which may execute with the pipeline ServiceAccount's permissions
Why this happens
PAC fails to enforce an authorization check connecting the Repository resource's creator to permission to create PipelineRuns. This is a missing authorization control, mapping to CWE-862: Missing Authorization. As a result, a user with limited resource permissions may cause actions to run under a more privileged ServiceAccount.
Potential impact
- An attacker could read Secrets available to the pipeline ServiceAccount.
- PipelineRuns may create, modify, or delete namespace resources.
- CI/CD resources or workflows may be altered, potentially enabling supply-chain injection.
- The effects may extend to resources within the namespace, depending on the ServiceAccount's permissions.
General mitigation guidance
Defensive patterns focus on enforcing authorization at the point where PAC accepts and processes Repository resources.
- Verify that the resource creator is authorized to initiate PipelineRuns.
- Apply least privilege to pipeline ServiceAccounts rather than relying on broad default roles.
- Restrict which users and automation identities can create or modify Repository and Secret resources.
- Constrain PipelineRun inputs and execution to approved definitions and trusted sources.
- Separate CI/CD identities and permissions by namespace and task where practical.
How teams detect issues like this
- Review authorization paths for Repository creation and PipelineRun execution, including whether the original user's permissions are checked.
- Use static analysis and code review to identify resource-triggered actions that run under more privileged identities without an explicit authorization check.
- Audit role bindings and ServiceAccount permissions for pipeline identities, especially broad edit permissions.
- Monitor Repository and PipelineRun creation alongside Secret access and namespace resource changes.
- Enforce policy checks that limit who may create Repository resources and which identities PipelineRuns may use.

