Summary
A broken authorization vulnerability in Kargo's batch resource creation endpoints allows attackers to inject unintended Kubernetes resources into a Project's namespace using the control plane's own high-privilege API credentials.
When an attacker can submit specially crafted multi-document YAML payloads to the legacy gRPC or newer REST batch creation APIs, they may escalate privileges, leading to remote code execution, secret theft, and downstream supply-chain attacks.
Affected context
This issue affects Kargo deployments using:
- The legacy gRPC batch resource creation endpoint, and/or
- The newer REST batch resource creation endpoint
where:
- The endpoints accept multi-document YAML payloads for resource creation
- The control plane uses high-privilege credentials to interact with the Kubernetes API server
- Projects share an underlying Kubernetes namespace that is assumed to be protected by Kargo's authorization logic
The vulnerability manifests when the API logic improperly constrains which resource types and targets can be created, allowing unintended resources to be injected into an existing Project's namespace.
Exploit preconditions
- Attack surface:
- Network access to Kargo's batch resource creation APIs (legacy gRPC and/or REST)
- Required access:
- Ability to authenticate or otherwise send requests to the affected endpoints under some Kargo-recognized identity (the specific level of intended privilege may be relatively low)
- Trigger point:
- Submission of a specially crafted multi-document YAML payload to the batch resource creation endpoint
- Payload exploits logic flaws to cause the Kargo control plane to create additional, unintended resources in the Project's namespace
- Why exploitation is possible:
- The authorization and validation logic for batch resource creation does not sufficiently restrict:
- Which resource types can be created, and/or
- How those resources are associated with an existing Project and its namespace
- The control plane uses its own Kubernetes API permissions to materialize resources, so injected resources inherit those stronger privileges.
Why this happens
The core issue is an incorrect authorization design in Kargo's batch resource creation logic (CWE-863).
The endpoints accept multi-document YAML payloads and are intended to create a constrained set of resources within a Project's namespace. However, the logic that validates and authorizes each document in the batch does not consistently enforce:
- Strict resource type allowlisting, and
- Tight scoping of what can be created under a given Project.
As a result, an attacker can submit a crafted multi-document YAML that includes additional, valid resource manifests of specific types that Kargo then applies using its own high-privilege Kubernetes API credentials. This pattern reflects a mismatch between the intended authorization policy (only certain, tightly controlled resources may be created) and the implementation (batch processing that implicitly trusts structure and relies on incomplete checks).
The flaw is not in YAML parsing itself but in how the application interprets and authorizes the set of documents, effectively turning Kargo into a confused deputy that performs privileged actions on behalf of a less-privileged caller.
Potential impact
- Creation of unauthorized resources in a Project's Kubernetes namespace using the control plane's privileges
- Privilege escalation for the attacker within Kargo and/or the underlying Kubernetes cluster
- Remote code execution via attacker-controlled workloads or hooks created under elevated permissions
- Secret exfiltration from the Project or cluster, including artifact repository credentials
- Compromise of artifact repositories, enabling supply-chain attacks against downstream environments
- Lateral movement within the cluster using injected permissions or kubectl in some cluster configurations
General mitigation guidance
Effective mitigation focuses on tightening authorization boundaries, scoping control-plane permissions, and constraining batch operations:
- Enforce strict resource allowlists:
- Gate batch creation to a narrowly defined set of resource kinds and API groups.
- Reject any document that does not match the expected schema and resource type for the endpoint.
- Apply robust per-document authorization:
- Treat each document in a multi-document YAML batch as an independent operation subject to:
- Full authorization checks, and
- Validation against the associated Project's policies and namespace.
- Ensure that the caller's effective permissions, not just the control plane's, govern which resources can be created.
- Scope control-plane privileges (least privilege):
- Limit service accounts used by Kargo so they can only:
- Create and modify the specific resource types required for normal operation
- Operate within the minimal set of namespaces actually needed
- Avoid blanket cluster-admin or broad namespace-wide roles where possible.
- Harden input handling for batch endpoints:
- Consider limiting or disabling multi-document YAML support where not strictly required.
- Apply schema validation (e.g., via JSON Schema or CRD schemas) to all incoming documents before they reach business logic.
- Isolate high-impact operations:
- Separate sensitive resource creation (e.g., RBAC, secrets, workloads) into specialized endpoints or workflows with stricter policies and review requirements.
These patterns reduce the blast radius even if a logic oversight occurs, by ensuring that no single endpoint can unilaterally create high-privilege resources on behalf of low-privilege callers.
How teams detect issues like this
Detecting and monitoring for this class of authorization issues can involve a combination of code-level and operational strategies:
- Static analysis and policy scanning:
- Scan for code paths that:
- Accept multi-document YAML or batch operations
- Use high-privilege Kubernetes clients or service accounts
- Apply resources without explicit per-document authorization checks
- Use rules that flag resource creation logic lacking clear allowlists or project/namespace scoping.
- Targeted code review:
- Review endpoints that:
- Perform bulk or batch operations
- Translate user-supplied manifests directly into Kubernetes API calls
- Look for:
- Shared "apply" functions that bypass caller-context checks
- Reliance on implicit assumptions about what clients will or will not submit.
- Runtime monitoring and audit logs:
- Enable Kubernetes API server audit logging and correlate:
- Resource creations initiated by Kargo service accounts
- With the originating user/API request in Kargo's own logs
- Alert on anomalous patterns such as:
- Creation of unexpected resource types
- Resource creation in namespaces or Projects not normally affected by a given user identity.
- Policy enforcement layers:
- Employ admission controllers (e.g., validating or mutating webhooks, OPA/Gatekeeper, Kyverno) to:
- Enforce cluster-wide policies on which resources Kargo can create
- Deny unexpected resource types or privileged configurations regardless of application bugs.
Automated review tools and CI checks that incorporate these signals can detect regressions in authorization logic before deployment.

