Summary
OpsTree BuildPiper before 2.7.0 has an authorization bypass that can let an authenticated user create an environment on a Kubernetes cluster assigned to another project. By altering cluster and namespace values in a request, the user may cross project boundaries and trigger builds or deployments on the targeted cluster.
Affected context
The issue occurs in BuildPiper's environment-creation API when authorization checks do not verify that the requested Kubernetes cluster and namespaces are assigned to the specified project. It may put project isolation at risk in deployments where authenticated users can submit requests to this endpoint and supply or modify these values.
Exploit preconditions
- Attack surface: The environment-creation API at
POST /api/v1/project/{project_id}/env/ - Required access: An authenticated BuildPiper account able to submit requests to the endpoint
- Trigger point: Environment creation with modified
cluster_idandnamespacesvalues - Why exploitation is possible: The request values can target resources outside the user's project when project ownership and authorization are not adequately checked
Why this happens
The underlying issue is missing or insufficient authorization enforcement, corresponding to CWE-862: Missing Authorization. The endpoint accepts resource identifiers from a request without reliably ensuring that the authenticated user is authorized to use the specified cluster and namespaces within the selected project.
Potential impact
- An attacker may create environments on clusters assigned to other projects.
- Builds or deployments could be triggered in resources outside the attacker's project.
- Project isolation and the integrity of workloads on affected clusters could be weakened.
- Unauthorized deployments could disrupt services or expose data, depending on cluster permissions and workloads.
General mitigation guidance
Defensive patterns focus on enforcing authorization at the point where resources are selected and used.
- Derive or verify cluster and namespace access from the authenticated user's project permissions rather than trusting request-supplied identifiers.
- Check project ownership and authorization for every requested resource before creating an environment or triggering downstream actions.
- Use secure-by-default access controls that deny cross-project operations unless explicitly granted.
- Limit the permissions available to build and deployment processes, and reduce trust in client-controlled identifiers.
How teams detect issues like this
- Review API handlers for authorization checks that bind the authenticated user, project, cluster, and namespaces together.
- Use static analysis and code review to identify endpoints that accept resource IDs without verifying ownership or access rights.
- Enforce policies that require server-side authorization for every resource operation, including asynchronous build and deployment workflows.
- Monitor environment-creation and deployment audit logs for requests where the selected cluster or namespaces do not belong to the specified project.

