Summary
Spinnaker's Kustomize bake operations previously allowed unsafe YAML tag processing in rosco manifests, enabling arbitrary object instantiation during parsing.
If an attacker can influence rosco manifest content, this behavior can lead to remote code execution on rosco pods when Kustomize bakes are performed.
Affected context
This vulnerability appears in Spinnaker deployments that use rosco for image baking and rely on Kustomize bakes to transform YAML-based manifests.
The risk is present when rosco processes manifests containing custom or untrusted YAML tags using deserialization routines that permit object construction.
Environments where manifest sources can be modified by less-trusted users or automated pipelines without strict validation are more exposed to this issue.
Exploit preconditions
- Attack surface: Rosco pods performing Kustomize bake operations on YAML manifests.
- Required access: Ability to create, modify, or inject YAML-based rosco manifests (e.g., via source repos, pipeline configuration, or artifact feeds).
- Trigger point: Execution of a Kustomize bake that parses the crafted manifest with unsafe YAML tag handling.
- Why exploitation is possible: The deserialization logic treats YAML tags as trusted, allowing construction of arbitrary types or execution hooks during manifest parsing, consistent with CWE-502 unsafe deserialization.
Why this happens
The root cause is the use of YAML parsing and deserialization mechanisms that permit processing of arbitrary tags and constructors in rosco manifests.
When Kustomize bakes run, these manifests are parsed with loaders that can instantiate complex objects or invoke behavior implicitly, rather than treating the YAML strictly as data.
This pattern aligns with CWE-502, where untrusted serialized input is deserialized into executable or operational objects, enabling attackers to embed logic in configuration that executes in the rosco pod context.
Potential impact
- Remote code execution within rosco pods during Kustomize bake operations.
- Compromise of the continuous delivery pipeline infrastructure.
- Manipulation of baked images or deployment artifacts prior to release.
- Potential pivot to other services or clusters reachable from compromised rosco pods.
- Interference with delivery workflows, causing deployment failures or introducing malicious changes.
General mitigation guidance
Effective mitigation focuses on eliminating unsafe deserialization paths and tightening trust boundaries around manifests.
Common patterns include:
- Using YAML loaders or parsers that disable arbitrary tag-based object construction and treat manifests as plain data.
- Enforcing strict schema validation and structural checks on manifests before they are accepted for Kustomize bakes.
- Restricting who can modify rosco manifests and related configuration, applying strong change controls and approvals.
- Running rosco pods with least privilege, limiting filesystem, network, and platform capabilities so that any code execution has minimal impact.
- Segregating build and bake infrastructure from critical control planes to reduce blast radius if a bake worker is compromised.
How teams detect issues like this
Detection typically involves a blend of code-level and process-level controls:
- Static analysis or policy-as-code rules that flag use of unsafe YAML loaders, constructors, or deserialization APIs in rosco-related components.
- Code review checklists that call out any parsing of external YAML data and require explicit confirmation of safe loader usage and schema validation.
- Pipeline governance that inspects manifest sources for unexpected tags or embedded constructors before allowing them into bake stages.
- Monitoring rosco pods for anomalous process behavior, command execution, or outbound connections during Kustomize bakes.
- Using automated security review tools integrated into CI to highlight unsafe deserialization patterns across deployment tooling.

