Use-after-free and double-free in AWS kmstool-enclave may enable code execution inside a Nitro Enclave

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2026-119116?

CVE-2026-119116 is a vulnerability classified as Use After Free and Double Free, affecting kmstool-enclave (affected versions: < 0.4.6). This vulnerability is rated High, with a CVSS score of 8.7. Current sources do not report this vulnerability as exploited.

Overview

Original source data

A use-after-free and double-free issue in the SetClient command handler of the kmstool-enclave sample application of AWS aws-nitro-enclaves-sdk-c before 0.4.6 may allow an application that runs on the parent EC2 instance to corrupt heap memory inside a Nitro Enclave which may lead to arbitrary code execution within the enclave. To remediate this issue, users should rebuild any enclave image that includes kmstool-enclave, or code derived from it, against aws-nitro-enclaves-sdk-c 0.4.6.

Affected products and scope

  • AWS kmstool-enclave: the normalized record identifies versions from 0 through less than 0.4.6 as affected.
  • The AWS advisory describes the corresponding impacted range as aws-nitro-enclaves-sdk-c <= v0.4.5, while clarifying that this CVE affects only kmstool-enclave or code derived from it, not the SDK library generally.
  • The GitHub advisory identifies 0.4.6 as the patched version. Enclave images containing kmstool-enclave or derivative code must be rebuilt; the status of parallel release branches is not separately established by the available evidence.

Technical details

The defect is in the SetClient command handler of the kmstool-enclave sample application in the AWS Nitro Enclaves SDK for C. An application running on the parent EC2 instance can send specially crafted control messages over vsock to kmstool-enclave; a sequence of SetClient and Decrypt messages can trigger use-after-free and double-free inside the enclave. Releasing or reusing invalid memory can corrupt the Nitro Enclave heap and may lead to arbitrary code execution within the enclave. The recorded preconditions are local reachability, low required privileges, high attack complexity, and no user interaction. The available advisory does not describe the heap layout, a memory-control primitive, or the exact implementation path from the memory error to code execution.

Exploitability

The vulnerable path is reachable from an application running on the parent EC2 instance that can send messages to the enclave over vsock. The record describes a local attack vector, low privileges required, high attack complexity, and no user interaction. The advisory states that cross-instance, cross-account, and cross-tenant access is not possible. The supplied record does not establish observed exploitation and does not identify a public exploit; that does not prove that exploitation has never occurred.

Technical impact

Successful exploitation can corrupt heap memory inside the Nitro Enclave and may result in arbitrary code execution within the enclave. Possible technical consequences include reading or modifying data available to the enclave workload, changing processing logic, or disrupting enclave service. The record characterizes confidentiality, integrity, and availability impact as high within the affected scope, but the advisory does not establish host takeover or access to other instances, accounts, or tenants. The practical consequence depends on the data, keys, and permissions held by the workload inside the enclave.

Business impact

  • An attacker may gain code execution inside an affected Nitro Enclave if they control an application running on the parent EC2 instance and meet the exploitation conditions.
  • Control of enclave code could compromise the confidentiality, integrity, or availability of data and workloads handled by that enclave.
  • The flaw can weaken the protection boundary between a parent instance and its enclave for images containing the vulnerable component.
  • The advisory does not indicate cross-instance, cross-account, or cross-tenant access, so the evidence does not support treating this as a broad AWS environment compromise.

Remediation

  1. Inventory all enclave images, forks, and internal code that contain kmstool-enclave or code derived from the sample application.
  2. Upgrade the AWS Nitro Enclaves SDK for C to version 0.4.6.
  3. Rebuild every affected enclave image with the patched version, then redeploy an image whose new build has been verified.
  4. Review forked and modified source to ensure the memory-management fixes are present rather than merely updating a dependency in an image that was not rebuilt.
  5. AWS states that there are no workarounds; upgrading and rebuilding are the confirmed remediation. Do not assume that updating one image or one unverified branch addresses the entire affected scope.

Detection

  1. Inventory enclave images and build pipelines to identify images containing kmstool-enclave or forked and derivative code.
  2. Review source trees, dependency manifests, and build provenance to identify the AWS Nitro Enclaves SDK for C release used to produce each image.
  3. Review parent applications that can send messages over vsock, with particular attention to flows using SetClient and Decrypt.
  4. As a precaution, monitor for parent applications sending malformed or unexpected control messages to an enclave. This is precautionary monitoring, not a vendor-confirmed indicator of compromise.
  5. Do not treat the absence of logs or alerts as proof that an image is safe; compare the deployed image directly with the source and dependency provenance used to build it.
Sources (19)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.