Summary
A code injection vulnerability in Yoke's Air Traffic Controller (ATC) allows arbitrary WebAssembly (WASM) modules to be fetched and executed based on a user-controlled URL in the overrides.yoke.cd/flight annotation.
When users with permission to create or update custom resources can influence this annotation, they may inject a malicious WASM module that runs in the controller context, potentially creating arbitrary Kubernetes resources and escalating privileges up to cluster-admin.
Affected context
This vulnerability affects Yoke deployments (version 0.19.0 and earlier) that use the Air Traffic Controller (ATC) component to manage infrastructure-as-code deployments via custom resources.
The issue specifically arises when:
- The ATC controller dynamically downloads and executes WASM modules based on the
overrides.yoke.cd/flightannotation. - URL values from this annotation are accepted without strict validation, origin restrictions, or integrity verification.
- Users with permissions to create or update the relevant custom resources exist in one or more namespaces.
In such environments, the controller's trust in annotation-specified URLs creates a high-risk execution path tied directly to cluster control operations.
Exploit preconditions
- Attack surface: Kubernetes API exposed to authenticated users who can create or update Yoke-related custom resources.
- Required access:
- Ability to create or modify the specific custom resource types processed by the ATC controller.
- Ability to set or change the
overrides.yoke.cd/flightannotation value. - Trigger point:
- The ATC controller reconciles a custom resource and reads the annotation.
- It then downloads the WASM module from the provided URL and executes it within the controller context.
- Why exploitation is possible:
- The controller treats the URL in the annotation as trusted input.
- There is no robust origin policy, URL allowlist, or integrity checking for the WASM module.
- WASM code is granted capabilities via the controller's permissions, enabling actions such as resource creation or modification.
Why this happens
The root cause is the unvalidated use of attacker-influenced input to determine executable code, aligning with CWE-94: Improper Control of Generation of Code ('Code Injection').
Conceptually:
- The ATC controller uses the
overrides.yoke.cd/flightannotation as a configuration knob for behavior. - Instead of constraining this configuration to a limited, vetted set of modules or sources, it allows arbitrary URLs.
- The controller then fetches and executes the referenced WASM module with its own privileges.
This pattern effectively lets configuration data dictate executable code, breaking the separation between data and logic.
Even though WASM executes inside a runtime, its integration with the controller's capabilities means that malicious modules can drive sensitive actions, turning a configuration field into a code execution vector.
Potential impact
- Execution of arbitrary WASM logic within the ATC controller context.
- Creation, modification, or deletion of Kubernetes resources accessible to the controller's RBAC permissions.
- Privilege escalation up to cluster-admin level if the controller holds or can obtain high-privilege roles.
- Unauthorized deployment or modification of infrastructure components, including secrets, workloads, and networking policies.
- Persistence of malicious logic by installing backdoored resources or controllers.
- Lateral movement across namespaces by leveraging the controller's cross-namespace access.
General mitigation guidance
Long-term mitigation focuses on re-establishing a clear trust boundary between configuration data and executable code, and constraining what the controller is allowed to run and from where.
Common defensive patterns include:
- Constrain sources of executable modules:
- Replace arbitrary URLs with a fixed set of approved, internally hosted WASM modules.
- Enforce strict allowlists for domains or paths from which modules can be fetched.
- Enforce integrity and authenticity:
- Require cryptographic signatures or checksums associated with modules and verify them before execution.
- Bind modules to versions and identities rather than free-form URLs.
- Demote configuration to non-executable selectors:
- Treat annotations as selectors or feature flags that map to predefined behaviors, not direct references to arbitrary code.
- Use a registry of known module IDs rather than letting users specify raw URLs.
- Harden the controller's privilege model:
- Apply least-privilege RBAC to the ATC controller, limiting which resources it can create or modify.
- Segment high-risk operations behind dedicated, separately controlled components.
- Reduce write access to sensitive CRs:
- Limit who can create or update the custom resources that drive ATC behavior, especially in shared or multi-tenant clusters.
- Use admission controls or policy engines to restrict or sanitize sensitive annotations such as
overrides.yoke.cd/flight.
How teams detect issues like this
Detection should focus both on code patterns and on runtime configuration that enables arbitrary code execution.
Static and configuration analysis:
- Search for controller code that:
- Reads user-supplied values (annotations, labels, fields) and uses them to construct URLs or module identifiers.
- Downloads and executes WASM or other plugins dynamically based on these values.
- Flag code paths where:
- No allowlist, URL validation, or signature verification is applied before module loading.
- Configuration values are used directly in network fetches or plugin loaders.
- Introduce SAST rules or manual review checklists for "dynamic plugin loading based on user-controlled data."
Policy and admission controls:
- Use Kubernetes admission controllers (e.g., OPA/Gatekeeper, Kyverno) to:
- Deny or mutate resources that include risky annotations like
overrides.yoke.cd/flightpointing to untrusted domains. - Enforce policies that restrict which users or service accounts can set such annotations.
- Monitor changes to high-impact custom resources and their annotations in audit logs.
Runtime monitoring and logging:
- Enable detailed logging in the ATC controller for:
- All external URLs used to fetch WASM modules.
- Module load and execution events.
- Use SIEM or log analysis tools to alert on:
- New or unexpected domains being used for module downloads.
- Unusual spikes in resource creation or modification correlated with ATC activity.

