GHSA-g9ww-x58f-9g6m: Github.com/edgelesssys/contrast Contrast BadAML Injection Allows Arbitrary Vulnerability

HIGH
CVSS 8.4
CWE-94
Published
Advisory Summary

GHSA-g9ww-x58f-9g6m is a HIGH (CVSS 8.4) contrast badaml injection allows arbitrary vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Github.com/edgelesssys/contrast libraries in the Go ecosystem. The issue involves contrast badaml injection allows arbitrary code execution. Remediation is available by upgrading affected packages to version 1.18.0.

GHSA-g9ww-x58f-9g6m at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-g9ww-x58f-9g6m
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Github.com/edgelesssys/contrast
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix GHSA-g9ww-x58f-9g6m

To remediate this vulnerability, upgrade all affected Github.com/edgelesssys/contrast dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/edgelesssys/contrast fixed: 1.18.0
Upgrade github.com/edgelesssys/contrast to 1.18.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/edgelesssys/contrast

How to Check if You Are Affected

To determine whether your application is affected by GHSA-g9ww-x58f-9g6m, inspect your project dependencies for Github.com/edgelesssys/contrast:

inspect dependencies for github.com/edgelesssys/contrast

Analyze the terminal output to locate any version of Github.com/edgelesssys/contrast in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.18.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Github.com/edgelesssys/contrast, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# 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 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.

GHSA-g9ww-x58f-9g6m Affected Github.com/edgelesssys/contrast Versions

1 component(s)
Fixed Versions:
1.18.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/edgelesssys/contrast
Go
< 1.18.0
1.18.0

References

Frequently Asked Questions

What is GHSA-g9ww-x58f-9g6m?
GHSA-g9ww-x58f-9g6m is a security vulnerability in Github.com/edgelesssys/contrast involving Contrast BadAML injection allows arbitrary code execution under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Github.com/edgelesssys/contrast versions are affected?
Affected versions include releases prior to 1.18.0 across affected packages: github.com/edgelesssys/contrast.
What version fixes GHSA-g9ww-x58f-9g6m?
Upgrading to 1.18.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/edgelesssys/contrast affected?
Yes, github.com/edgelesssys/contrast is affected in releases prior to 1.18.0. Upgrade your dependency to 1.18.0 or later.
What is the CVSS score of GHSA-g9ww-x58f-9g6m?
GHSA-g9ww-x58f-9g6m has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N.
What CWE is associated with GHSA-g9ww-x58f-9g6m?
GHSA-g9ww-x58f-9g6m is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check Go dependencies for GHSA-g9ww-x58f-9g6m?
Run the dependency tree command: 'inspect dependencies for github.com/edgelesssys/contrast'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-g9ww-x58f-9g6m",
  "modified" : "2026-03-26T19:49:27Z",
  "published" : "2026-03-26T19:49:27Z",
  "aliases" : [ ],
  "summary" : "Contrast BadAML injection allows arbitrary code execution",
  "details" : "# BadAML\n\nBadAML 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:\n\n- <https://blackhat.com/eu-24/briefings/schedule/#aml-injection-attacks-on-confidential-vms-42723>\n- <https://dl.acm.org/doi/pdf/10.1145/3719027.3765123>\n\n## Impact\n\nAn 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.\n\nAML 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.\n\nSee the [paper](https://dl.acm.org/doi/pdf/10.1145/3719027.3765123) for a detailed description and background of the attack.\n\nNote that this is not a vulnerability specific to Contrast, but rather a generic vulnerability in Confidential Computing setups that use the ACPI interface.\n\n## Affected platforms\n\nThis issue affects the SNP platforms supported by Contrast: `Metal-QEMU-SNP` and `Metal-QEMU-SNP-GPU`.\nUsers on these platforms should switch to the fixed Contrast version immediately.\n\n`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.\n\n## Patches\n\nA 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.\n\nThis 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/edgelesssys/contrast"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.18.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/edgelesssys/contrast/security/advisories/GHSA-g9ww-x58f-9g6m"
  }, {
    "type" : "WEB",
    "url" : "https://blackhat.com/eu-24/briefings/schedule/#aml-injection-attacks-on-confidential-vms-42723"
  }, {
    "type" : "WEB",
    "url" : "https://dl.acm.org/doi/pdf/10.1145/3719027.3765123"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/edgelesssys/contrast"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-26T19:49:27Z",
    "nvd_published_at" : null
  }
}