CVE-2026-112408
SageMaker SDK missing bucket ownership check leads to remote code execution.
- CVSS 9.4
- CWE-940
- Authentication, Authorization, and Session Management
- Remote
Missing verification of source of a communication channel in the default_bucket() function in Amazon SageMaker Python SDK V3 before 3.10.0 and V2 before 2.257.3 might allow remote actors to achieve code execution in the target SageMaker execution environment and obtain IAM credentials via pre-creation of a predictably named S3 bucket that the SDK uses without ownership validation. To remediate this issue, users should upgrade to Amazon SageMaker Python SDK 3.10.0 (V3) or 2.257.3 (V2).
- CWE
- CWE-940
- CVSS base score
- 9.4
- Published
- 2026-10-21
- OWASP
- A01 Broken Access Control
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Authentication, Authorization, and Session Management
- Subcategory
- Insecure Direct Object References (IDOR)
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Amazon SageMaker Python SDK
- Fixed by upgrading
- Yes
Solution
Upgrade the SDK to Amazon SageMaker Python SDK v3.10.0 (or newer) or v2.257.3 (or newer).
Vulnerable code sample
import boto3
from sagemaker.session import Session
def upload_artifact(sagemaker_session: Session, local_path: str, key: str):
# VULNERABLE: uses default bucket without ownership verification
bucket = sagemaker_session.default_bucket()
s3 = boto3.client('s3')
s3.upload_file(Filename=local_path, Bucket=bucket, Key=key)Patched code sample
import boto3
from sagemaker.session import Session
from botocore.exceptions import ClientError
def upload_artifact(sagemaker_session: Session, local_path: str, key: str):
# FIX: verify bucket ownership before use
bucket = sagemaker_session.default_bucket()
s3 = boto3.client('s3')
try:
resp = s3.head_bucket(Bucket=bucket)
owner = resp.get('ResponseMetadata', {}).get('HTTPHeaders', {}).get('x-amz-bucket-owner')
# Simple check: ensure owner matches the current AWS account ID
sts = boto3.client('sts')
acct_id = sts.get_caller_identity()['Account']
if owner != acct_id:
raise PermissionError(f"Bucket {bucket} is not owned by this account")
except ClientError as e:
raise PermissionError(f"Unable to verify bucket ownership: {e}")
s3.upload_file(Filename=local_path, Bucket=bucket, Key=key)Cite this entry
@misc{vaitp:cve2026112408,
title = {{SageMaker SDK missing bucket ownership check leads to remote code execution.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-112408},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-112408/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
