Contrast BadAML injection allows arbitrary code execution
Date: 2026-03
Affected: go/github.com/edgelesssys/contrast
Attack vector: rce
Category: vulnerability-disclosure
Severity: High
CWE: CWE-94
CVSS: 8.4 (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N)

# BadAML BadAML is an AML injection attack that exploits the ACPI interface and allows arbitrary code execution in a confidential VM. The attack was first published in 2024: - <https://blackhat.com/eu-24/briefings/schedule/#aml-injection-attacks-on-confidential-vms-42723> - <https://dl.acm.org/doi/pdf/10.1145/3719027.3765123> ## Impact An attacker with control over the host (which is assumed in the attacker model of Contrast) can execute malicious AML code to gain arbitrary code execution within the confidential guest. AML is byte code embedded in ACPI tables that are passed from the host (QEMU) to the guest firmware (OVMF), and then passed from OVMF to the Linux kernel. The Linux kernel has an interpreter that executes the AML code. An attacker can craft a table with malicious AML code and the kernel will execute it. AML is Turing-complete and the interpreter has access to the full guest memory, including private pages. See the [paper](https://dl.acm.org/doi/pdf/10.1145/3719027.3765123) for a detailed description and background of the attack. Note that this is not a vulnerability specific to Contrast, but rather a generic vulnerability in Confidential Computing setups that use the ACPI interface. ## Affected platforms This issue affects the SNP platforms supported by Contrast: `Metal-QEMU-SNP` and `Metal-QEMU-SNP-GPU`. Users on these platforms should switch to the fixed Contrast version immediately. `Metal-QEMU-TDX` isn't affected, as the content of the ACPI tables


Mitigations:

Architectural layers (MAESTRO):