Get a Demo

Let's Patch It!

Book a short call with one our specialists, we'll walk you through how Endor Patches work, and ask you a few questions about your environment (like your primary programming languages and repository management). We'll also send you an email right after you fill out the form, feel free to reply with any questions you have in advance!

CVE

GHSA-g9ww-x58f-9g6m

Contrast BadAML injection allows arbitrary code execution
Back to all
CVE

GHSA-g9ww-x58f-9g6m

Contrast BadAML injection allows arbitrary code execution

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:

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 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 is covered by the runtime measurements (measured into RTMR 0 by OVMF) on Intel TDX.

Patches

A sandbox similar to the one proposed in the paper has been implemented in the Linux kernel used by Contrast. The sandbox denies access to private memory pages by doing a page table lookup on every read/write by the AML interpreter.

This mitigates the attack completely: While an attacker can still run AML code, the code cannot read or modify private memory pages. Shared pages are readable/writable by the host hypervisor anyway.

Package Versions Affected

Package Version
patch Availability
No items found.

Automatically patch vulnerabilities without upgrading

Fix Without Upgrading
Detect compatible fix
Apply safe remediation
Fix with a single pull request

CVSS Version

Severity
Base Score
CVSS Version
Score Vector
C
H
U
-
C
H
U
0
-
3.1
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N
C
H
U
-

Related Resources

No items found.

References

https://github.com/edgelesssys/contrast/security/advisories/GHSA-g9ww-x58f-9g6m, https://blackhat.com/eu-24/briefings/schedule/#aml-injection-attacks-on-confidential-vms-42723, https://dl.acm.org/doi/pdf/10.1145/3719027.3765123, https://github.com/edgelesssys/contrast

Severity

8.4

CVSS Score
0
10

Basic Information

Ecosystem
Base CVSS
8.4
EPSS Probability
0%
EPSS Percentile
0%
Introduced Version
0
Fix Available
1.18.0

Fix Critical Vulnerabilities Instantly

Secure your app without upgrading.
Fix Without Upgrading