# Sandbox escape via incomplete option denylist

User-supplied sandbox options filtered by a hardcoded denylist; check every key that reaches the privileged layer

_Area: Cloud and container security. Seen in 2 disclosed reports; latest 2026-05-21. Updated 2026-11-16._

## How it works
A sandbox or VM platform lets tenants pass configuration options, then tries to keep them safe by blocking a hardcoded list of dangerous keys. The assumption that breaks: that the denylist is complete. Any key the list omits is accepted and injected verbatim into the privileged layer (hypervisor config, AppArmor profile, mount device, script interpreter), so the tenant reaches primitives the platform meant to withhold. The same failure appears when a security flag is enforced only in the untrusted guest rather than at the device layer [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-g6ww-w5j2-r7x3.md), or when user scripts are executed in-process by a controller holding its own credentials [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-xrwg-mqj6-6m22.md).

## Where it shows up
- A function like `isVMLowLevelOptionForbidden` with a literal key list, next to a sibling list for another resource type [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-fm2x-c5qw-4h6f.md).
- `raw.*` config keys that flow into QEMU args, AppArmor profiles, or driver config without a second check [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-fm2x-c5qw-4h6f.md).
- Security flags that are logged or parsed but never forwarded to the privileged API (e.g. `read_only` dropped before `add_virtiofs`) [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-g6ww-w5j2-r7x3.md).
- Guest-side enforcement (`-o ro`, `MS_RDONLY`) combined with broad capabilities such as `CAP_SYS_ADMIN` [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-g6ww-w5j2-r7x3.md).
- Controllers that validate user-supplied scripts by executing them in-process under the controller's service account [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-xrwg-mqj6-6m22.md).

## How to review
Find the control and ask what it actually gates. The invariant: every user-controlled key or flag that reaches the privileged layer must be either rejected by an allowlist or enforced below the trust boundary (hypervisor/device layer), not in the guest or by a partial list. Concretely: diff the denylist against the sibling control and against the full set of keys the driver consumes [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-fm2x-c5qw-4h6f.md); grep for security flags that are set but not passed to the privileged call [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-g6ww-w5j2-r7x3.md); check whether script validation runs with the controller's own identity [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-xrwg-mqj6-6m22.md).

## How finders spotted it
- Compared the VM forbidden-key function against the container equivalent, noticed `raw.apparmor` in one list but not the other, then traced which other VM keys were unlisted and where they were injected [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-fm2x-c5qw-4h6f.md).
- Read the mount path and saw `read_only` only logged, never passed to `add_virtiofs`; confirmed the FFI had no read-only variant and that all capabilities were granted [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-g6ww-w5j2-r7x3.md).

## Variants seen
- Missing keys in a hardcoded VM denylist, chained to bridge a socket into the guest [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-fm2x-c5qw-4h6f.md).
- Read-only mount enforced only guest-side, defeated by remount with `CAP_SYS_ADMIN` [E2](https://bugbountylibrary.com/r/ghsa%3AGHSA-g6ww-w5j2-r7x3.md).
- User-supplied Lua executed unsandboxed by a controller, exposing file/OS access [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-xrwg-mqj6-6m22.md).

## Impact and severity
High: each case crossed the sandbox boundary. E1 reached cluster admin and host root via a privileged container; E2 turned a read-only share into host code execution and supply-chain compromise; E3 exposed the controller SA token, TLS keys, and pod creation. Impact rose where the escaped identity held broad entitlements [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-fm2x-c5qw-4h6f.md)[E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-xrwg-mqj6-6m22.md).

## Seen in real software
Open-source packages and projects, and products, where this pattern was found. If the target runs one, compare the version it runs with the fix.
- **boxlite (pip)** < 0.9.0, fixed in 0.9.0: BoxLite: Permission Bypass Allows Modification of Read-Only Files (CVE-2026-46695). Report: https://bugbountylibrary.com/r/ghsa%3AGHSA-g6ww-w5j2-r7x3.md. Fix: https://github.com/boxlite-ai/boxlite/pull/454
- **github.com/canonical/lxd (go)** >= 0.0.0-20210305023314-538ac3df036e, <= 0.0.0-20260226085519-736f34afb267, no fix yet: LXD: VM lowlevel restriction bypass via raw.apparmor and raw.qemu.conf (CVE-2026-34177). Report: https://bugbountylibrary.com/r/ghsa%3AGHSA-fm2x-c5qw-4h6f.md. Fix: https://github.com/canonical/lxd/pull/17909

## Evidence
- E1: https://bugbountylibrary.com/r/ghsa%3AGHSA-fm2x-c5qw-4h6f.md
- E2: https://bugbountylibrary.com/r/ghsa%3AGHSA-g6ww-w5j2-r7x3.md
- E3: https://bugbountylibrary.com/r/ghsa%3AGHSA-xrwg-mqj6-6m22.md
