﻿# A CDI device request can inject mounts, environment and executable hooks

A practical investigation of a CDI device request can inject mounts, environment and executable hooks, with explicit observations, control cases and evidence limits.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/field-security-cdi-container-edits-hook-authority/
Language: en

## The operational scenario

A serving deployment approves a qualified CDI accelerator name after checking its device-node list. A refreshed specification retains the same name but adds a mount or executable hook. The device selection still looks unchanged, while the resulting container setup can acquire different behavior. A name approval must therefore identify the effective specification and its edits, not merely the requested accelerator label.

## The trust-boundary mechanism

The CDI specification describes transformation of the OCI configuration through containerEdits. Edits can include environment values, mounts, device nodes and hooks; some apply when a matching device is requested and others when any device from that specification is selected. OCI hooks execute programs at defined lifecycle phases with phase-specific namespace rules. This is executable setup authority, not simply passive data describing a hardware inventory.

## Define the control contract

Define the allowed edit classes and ownership of specification generation. Record hook executable identity, arguments, environment and lifecycle phase without storing secrets. A hook path alone does not prove reviewed bytes if another actor can replace its target. Specify how updates to the specification and referenced resources become reviewable, and distinguish a trusted runtime integration from untrusted application-provided configuration.

## A step-by-step verification

First inspect the complete discovered specification and resolve the qualified device through the intended engine. Next compare the resulting OCI edits against an approved baseline in a disposable fixture. Use harmless marker hooks only if execution is explicitly part of the authorized test; otherwise perform static comparison. Finally vary a global edit separately from a device-local edit to confirm the actual selection scope without touching a real accelerator.

## Evidence required for acceptance

Acceptance requires the resolved specification identity, source owner, referenced executable identities and an accounted set of resulting edits. Preserve the hook phase and execution namespace from the applicable runtime specification. A successful container launch proves neither that unexpected setup was absent nor that every mount was required. Record unexplained changes as review failures even if the model still answers the synthetic request correctly.

## Failure cases and limits

CDI integrations legitimately need libraries and setup beyond a single device node. This review does not prohibit those requirements or assume all hooks run in one namespace. It makes their authority explicit. Registry conflict resolution, runtime compatibility and actual compute readiness remain different checks. The security artifact should explain the transformation admitted for this device request, rather than treating an unchanged qualified name as an immutable permission grant.

## Primary references and related reading

Review CDI as an OCI configuration transformation, including hook provenance and lifecycle authority. [CDI container edits and hooks specification](https://raw.githubusercontent.com/cncf-tags/container-device-interface/main/SPEC.md); [OCI runtime hooks and mount configuration](https://raw.githubusercontent.com/opencontainers/runtime-spec/main/config.md).

The proposed investigation of cdi container edits hook authority is a proposed control review; no live security test was executed. Related reading: [Diagnose conflicting CDI device definitions across search directories](/journal/guide-linux-cdi-duplicate-specs/); [Kubernetes device plugins: an allocated accelerator is an access contract, not a complete sandbox](/journal/kubernetes-device-plugin-allocation-access-contract-security-lifecycle/).
