Summary
containerd's CRI implementation can improperly honor Container Device Interface (CDI) annotations from untrusted checkpoint image metadata when restoring containers.
In environments with CDI enabled and matching host CDI specifications, a user with pod creation rights could inject arbitrary device and host mount edits into restored containers, bypassing normal Kubernetes resource and device plugin enforcement.
Affected context
This vulnerability occurs in Kubernetes environments using containerd as the runtime with CDI support enabled and checkpoint/restore workflows in use.
The risk arises when containers are restored from checkpoints whose metadata includes CDI annotations; containerd preserves these annotations instead of exclusively relying on the original pod specification.
Clusters where CDI is disabled or where CDI specifications do not reference sensitive devices (such as GPUs, host filesystems, or accelerators) are less exposed but still benefit from hardening.
Exploit preconditions
- Attack surface: Kubernetes control plane and containerd node runtime via checkpoint-based container restore operations.
- Required access: Ability to create pods and influence or supply checkpoint images/metadata for containers that will be restored.
- Trigger point: Container restoration from a checkpoint archive containing crafted CDI annotations.
- Why exploitation is possible: The CRI implementation trusts CDI-related annotations embedded in checkpoint metadata instead of validating or reconciling them strictly against the pod's create-time specification and policy constraints, allowing unauthorized device and mount configuration to be applied.
Why this happens
The core issue is improper validation and trust of external metadata in the container restore path.
When restoring a container, the CRI code path accepts CDI-related annotations from the checkpoint archive and carries them forward without fully re-validating them against the original pod specification, Kubernetes resource model, or device plugin policies.
This maps to CWE-20: Improper Input Validation, as the system treats checkpoint annotations as trustworthy configuration without enforcing expected constraints, and is related to CWE-863: Incorrect Authorization, since device and mount access is effectively granted outside the standard authorization and scheduling pipeline.
Potential impact
- Bypass of Kubernetes device plugin and resource allocation controls.
- Injection of unauthorized device nodes into containers, potentially enabling access to GPUs, accelerators, or other sensitive hardware.
- Injection of unexpected host filesystem mounts into containers, which can lead to data exfiltration or modification of host resources.
- Establishment of container escape primitives if privileged device nodes or host paths are exposed, potentially compromising the node.
- Violation of multi-tenant isolation guarantees in shared clusters where untrusted tenants can create pods.
General mitigation guidance
Effective mitigation focuses on re-establishing strict trust boundaries and validation in the container restore path and limiting high-risk CDI exposure:
- Ensure that configuration and metadata used during restore are derived from the original, authoritative pod specification rather than untrusted checkpoint annotations.
- Apply strict validation of CDI annotations during restore, enforcing the same policies and constraints used at pod creation time, including device plugin and resource checks.
- Limit CDI specifications to the minimum necessary devices and avoid exposing highly sensitive device nodes or host paths where possible.
- Use runtime security policies (such as admission controls or pod security standards) to restrict which workloads can use checkpoint/restore and CDI features.
- Apply least-privilege principles on cluster roles so that only trusted automation can combine pod creation rights with access to checkpoint/restore workflows.
How teams detect issues like this
Organizations can detect and monitor for this class of issue by:
- Reviewing containerd and CRI code paths for any use of annotations or metadata from checkpoint archives that are not re-validated against the pod spec.
- Applying static analysis rules or linters to flag flows where external metadata (e.g., checkpoint contents) directly influence CDI configuration or device assignments.
- Incorporating security-focused code review checklists that require explicit validation of restore-time configuration against creation-time policies and device plugin constraints.
- Instrumenting audit logs in Kubernetes and on nodes to correlate checkpoint/restore operations with unexpected device or host mount assignments in restored pods.
- Using policy engines (such as admission controllers or runtime enforcement tools) to detect pods whose device assignments or mounts deviate from expected configurations.

