CVE-2026-8596: SageMaker SDK: cleartext HMAC key enables model artifact RCE
GHSA-7hh5-prp2-mfh5 HIGHThe Amazon SageMaker Python SDK (versions 2.199.0–2.257.1 and 3.0.0–3.7.1) stores an HMAC model integrity signing key as a cleartext container environment variable returned verbatim by SageMaker's DescribeModel, DescribeEndpointConfig, and DescribeModelPackage APIs. An authenticated attacker holding describe API permissions plus S3 write access to the model artifact path can extract the key directly from the API response, forge valid HMAC signatures on a crafted malicious model artifact, and achieve code execution inside SageMaker inference containers under the execution role's full IAM permissions — a foothold into the broader AWS environment. With 51 downstream dependents and EPSS placing this in the top 73rd percentile for exploitation likelihood, the realistic threat profile is a compromised CI/CD credential or over-permissioned developer role — a common posture in ML teams. Organizations must immediately upgrade to SDK v2.257.2 or v3.8.0 and rebuild all ModelBuilder-deployed models, since models built with affected versions retain the exposed key in their configuration even after the SDK is patched.
What is the risk?
CVSS 7.2 High (AV:N/AC:L/PR:H/UI:N) with High impact across confidentiality, integrity, and availability. The primary guard — PR:H (high privileges required) — limits opportunistic exploitation; however, in AWS environments, IAM role proliferation and broadly-scoped CI/CD pipelines make the required access pattern common in practice. The chaining of cleartext credential disclosure with model artifact forgery and subsequent inference container code execution elevates operational risk meaningfully above the raw CVSS score. No public exploit or KEV listing at time of publication, but the attack requires no specialized AI/ML expertise beyond AWS API familiarity, lowering the bar for any attacker who already holds the prerequisite permissions.
Attack Kill Chain
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| sagemaker | pip | >= 2.199.0, <= 2.257.1 | 2.257.2 |
Do you use sagemaker? You're affected.
Severity & Risk
Attack Surface
What should I do?
6 steps-
Upgrade sagemaker SDK to v2.257.2 (v2 branch) or v3.8.0 (v3 branch) immediately.
-
After upgrading, rebuild all models previously deployed with ModelBuilder — SDK upgrade alone does not fix already-deployed models with the key embedded in container configuration.
-
If immediate upgrade is not possible, manually recreate SageMaker models without the SAGEMAKER_SERVE_SECRET_KEY environment variable in the container environment configuration as a temporary workaround.
-
Detect exposure by auditing existing models: run
aws sagemaker describe-model --model-name <name>and inspect the Containers[].Environment block for SAGEMAKER_SERVE_SECRET_KEY. -
Tighten IAM: restrict DescribeModel, DescribeEndpointConfig, and DescribeModelPackage permissions to least-privilege; audit S3 bucket policies for model artifact paths to limit write access.
-
Treat any model artifact whose associated HMAC key was potentially exposed as untrusted until rebuilt.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-8596?
The Amazon SageMaker Python SDK (versions 2.199.0–2.257.1 and 3.0.0–3.7.1) stores an HMAC model integrity signing key as a cleartext container environment variable returned verbatim by SageMaker's DescribeModel, DescribeEndpointConfig, and DescribeModelPackage APIs. An authenticated attacker holding describe API permissions plus S3 write access to the model artifact path can extract the key directly from the API response, forge valid HMAC signatures on a crafted malicious model artifact, and achieve code execution inside SageMaker inference containers under the execution role's full IAM permissions — a foothold into the broader AWS environment. With 51 downstream dependents and EPSS placing this in the top 73rd percentile for exploitation likelihood, the realistic threat profile is a compromised CI/CD credential or over-permissioned developer role — a common posture in ML teams. Organizations must immediately upgrade to SDK v2.257.2 or v3.8.0 and rebuild all ModelBuilder-deployed models, since models built with affected versions retain the exposed key in their configuration even after the SDK is patched.
Is CVE-2026-8596 actively exploited?
No confirmed active exploitation of CVE-2026-8596 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-8596?
1. Upgrade sagemaker SDK to v2.257.2 (v2 branch) or v3.8.0 (v3 branch) immediately. 2. After upgrading, rebuild all models previously deployed with ModelBuilder — SDK upgrade alone does not fix already-deployed models with the key embedded in container configuration. 3. If immediate upgrade is not possible, manually recreate SageMaker models without the SAGEMAKER_SERVE_SECRET_KEY environment variable in the container environment configuration as a temporary workaround. 4. Detect exposure by auditing existing models: run `aws sagemaker describe-model --model-name <name>` and inspect the Containers[].Environment block for SAGEMAKER_SERVE_SECRET_KEY. 5. Tighten IAM: restrict DescribeModel, DescribeEndpointConfig, and DescribeModelPackage permissions to least-privilege; audit S3 bucket policies for model artifact paths to limit write access. 6. Treat any model artifact whose associated HMAC key was potentially exposed as untrusted until rebuilt.
What systems are affected by CVE-2026-8596?
This vulnerability affects the following AI/ML architecture patterns: model serving, ML inference pipelines, SageMaker MLOps pipelines, multi-model endpoints.
What is the CVSS score for CVE-2026-8596?
CVE-2026-8596 has a CVSS v3.1 base score of 7.2 (HIGH). The EPSS exploitation probability is 0.10%.
Technical Details
NVD Description
## Summary Amazon SageMaker Python SDK is an open-source library for training and deploying machine learning models on Amazon SageMaker. An issue exists where, under certain circumstances, the ModelBuilder/Serve component stores an HMAC signing key in cleartext as a container environment variable, which is returned in plaintext by SageMaker describe APIs. ## Impact When using ModelBuilder to build and deploy models with affected model servers (TorchServe, Multi-Model Server, TensorFlow Serving, SMD, or Triton), the SDK generates an HMAC secret key for model artifact integrity verification and stores it as the SAGEMAKER_SERVE_SECRET_KEY environment variable in the SageMaker model container configuration. This environment variable is returned in plaintext by the DescribeModel, DescribeEndpointConfig, and DescribeModelPackage APIs. A remote authenticated actor with permissions to call these describe APIs and S3 write access to the model artifact path could extract the key, forge valid integrity signatures for specially crafted model artifacts, and achieve code execution in inference containers with the SageMaker execution role's IAM permissions. **Impacted versions:** >= v2.199.0 AND <= v2.257.1, >= v3.0.0 AND <= v3.7.1 ## Patches This issue has been addressed in Amazon SageMaker Python SDK v2.257.2 and v3.8.0. AWS recommend upgrading to the latest version and rebuilding any models previously created with ModelBuilder using the updated SDK. Models created with affected versions may still have the HMAC key stored in their container environment variables until they are rebuilt with the patched SDK. Ensure any forked or derivative code is patched to incorporate the new fixes. ## Workarounds If upgrading is not immediately possible, users can manually remove the SAGEMAKER_SERVE_SECRET_KEY environment variable from existing SageMaker models by recreating the model without this variable in the container environment configuration. ## References If there any questions or comments about this advisory, contact AWS Security via the [vulnerability reporting page](https://aws.amazon.com/security/vulnerability-reporting) or directly via email to [aws-security@amazon.com](mailto:aws-security@amazon.com). Please do not create a public GitHub issue.
Exploitation Scenario
An adversary with compromised developer or CI/CD credentials — common in ML teams where IAM roles are broadly scoped — first enumerates SageMaker models via DescribeModel. The API response includes the container environment block with SAGEMAKER_SERVE_SECRET_KEY in cleartext. The attacker crafts a malicious TorchServe model archive containing a reverse shell payload, computes a valid HMAC signature using the extracted key so it passes integrity verification, and overwrites the legitimate artifact at the model's S3 path using available write permissions. On the next endpoint invocation or model reload, SageMaker fetches and validates the forged artifact — HMAC check passes — and executes the attacker's payload inside the inference container. The attacker now holds a shell running under the SageMaker execution role's IAM permissions, enabling lateral movement to other AWS services such as S3, Secrets Manager, and DynamoDB accessible within the same account.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H References
- aws.amazon.com/security/security-bulletins/2026-031-aws
- github.com/advisories/GHSA-7hh5-prp2-mfh5
- github.com/aws/sagemaker-python-sdk/releases/tag/v2.257.2
- github.com/aws/sagemaker-python-sdk/releases/tag/v3.8.0
- github.com/aws/sagemaker-python-sdk/security/advisories/GHSA-7hh5-prp2-mfh5
- nvd.nist.gov/vuln/detail/CVE-2026-8596
Timeline
Related Vulnerabilities
CVE-2026-1777 7.2 sagemaker: security flaw enables exploitation
Same package: sagemaker CVE-2026-8597 7.2 SageMaker: RCE via poisoned Triton model artifacts in S3
Same package: sagemaker CVE-2025-0508 5.9 SageMaker SDK: MD5 collision silently replaces ML workflows
Same package: sagemaker CVE-2026-1778 5.9 sagemaker: security flaw enables exploitation
Same package: sagemaker GHSA-5r2p-pjr8-7fh7 sagemaker: Allowlist Bypass evades input filtering
Same package: sagemaker