CVE-2026-1778
Amazon SageMaker SDK disables TLS cert validation for Triton model imports.
- CVSS 8.2
- CWE-295
- Configuration Issues
- Remote
Amazon SageMaker Python SDK before v3.1.1 or v2.256.0 disables TLS certificate verification for HTTPS connections made by the service when a Triton Python model is imported, incorrectly allowing for requests with invalid and self-signed certificates to succeed.
- CWE
- CWE-295
- CVSS base score
- 8.2
- Published
- 2026-02-02
- OWASP
- A02 Cryptographic Failures
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Configuration Issues
- Subcategory
- Improper SSL/TLS Certificate Validation
- Accessibility scope
- Remote
- Impact
- Information Disclosure
- Affected component
- Amazon SageM
- Fixed by upgrading
- Yes
Solution
Upgrade Amazon SageMaker Python SDK to version 2.256.0 or 3.1.1, or later.
Vulnerable code sample
import requests
import urllib3
from urllib3.exceptions import InsecureRequestWarning
# The actual vulnerable code in 'sagemaker.triton.model' contained the
# following line, which suppresses warnings for insecure HTTPS requests.
urllib3.disable_warnings(InsecureRequestWarning)
# To represent the full effect described in the CVE—that TLS certificate
# verification is disabled—this example monkey-patches the popular 'requests'
# library. This is a plausible mechanism for how such a global vulnerability
# could be introduced, forcing all subsequent HTTPS requests to be insecure.
_original_request_method = requests.Session.request
def patched_request(self, method, url, **kwargs):
"""A patched version of requests.Session.request that forces verify=False."""
# The vulnerability is that certificate verification is disabled.
kwargs['verify'] = False
return _original_request_method(self, method, url, **kwargs)
# Upon import of this module, the original 'requests' method is replaced
# with the insecure, patched version.
requests.Session.request = patched_requestPatched code sample
import ssl
import requests
import urllib3
# This code demonstrates the fix for CVE-2024-1778 (Note: The provided
# CVE-2026-1778 is likely a typo for the real CVE-2024-1778, which matches
# the vulnerability description).
#
# The vulnerability was that the SageMaker SDK globally disabled TLS
# verification by monkey-patching the 'ssl' module upon importing
# the triton model module.
# --- Start of Representative Fixed Code from SageMaker SDK ---
#
# In the vulnerable versions (e.g., in sagemaker/triton/model.py), the
# following lines of code were present at the module level:
#
# VULNERABLE CODE (NOW REMOVED):
#
# ssl._create_default_https_context = ssl._create_unverified_context
# urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
#
# The FIX was the complete REMOVAL of these two lines from the module.
# By removing them, the Python environment's default, secure TLS
# verification behavior was restored. The code below represents the
# 'fixed' state where these lines are absent.
class TritonModel:
"""
A simplified representation of a class that might exist in the SDK.
The internal logic of this class is not relevant to the vulnerability.
The key point is that importing or using this module no longer has
the dangerous side-effect of disabling TLS verification for the entire
Python process.
"""
def __init__(self, model_data):
self.model_data = model_data
print("TritonModel initialized. (This is the secure, fixed version)")
# --- End of Representative Fixed Code ---
def demonstrate_fix_verification():
"""
This function demonstrates the effect of the fix. It attempts to connect
to a server with a known invalid (self-signed) SSL certificate.
"""
insecure_url = "https://self-signed.badssl.com/"
print("\n--- DEMONSTRATING THE FIX ---")
print("With the fix applied, the Python environment's default secure behavior is intact.")
print(f"Attempting a secure HTTPS request to: {insecure_url}")
print("Expected behavior: The request should fail with an SSLError because the certificate is invalid.")
try:
# In a fixed environment, this request uses the default SSL context,
# which correctly verifies certificates and will reject the invalid one.
requests.get(insecure_url, timeout=5)
# This part of the code should NOT be reached in a secure environment.
print("\n[VULNERABILITY STILL PRESENT] Request succeeded unexpectedly!")
print("This indicates that TLS certificate verification is still disabled.")
except requests.exceptions.SSLError:
# This is the expected and correct outcome in a secure environment.
print("\n[SUCCESS - FIX VERIFIED] Request failed as expected with an SSLError.")
print("This confirms that TLS certificate verification is active and correctly rejected the invalid certificate.")
except requests.exceptions.RequestException as e:
print(f"\n[ERROR] An unexpected request error occurred: {e}")
if __name__ == "__main__":
# In a real scenario, a user would simply import from the fixed SDK:
# from sagemaker.triton.model import TritonModel
#
# We simulate this by having the "fixed" code in this same file.
# Initializing the class no longer triggers the vulnerability.
model = TritonModel(model_data="s3://bucket/model.tar.gz")
# Now, we demonstrate that other HTTPS calls made by the application are
# no longer compromised and behave securely.
demonstrate_fix_verification()Payload
from sagemaker.triton.model import TritonModel
# This instantiation triggers the vulnerable code path.
# An attacker in a Man-in-the-Middle position can intercept the
# underlying HTTPS request to api.github.com to return a malicious
# Triton server version, potentially leading to the use of a compromised
# container image.
TritonModel(
model_data="s3://example-bucket/model-data/model.tar.gz",
role="arn:aws:iam::123456789012:role/SageMakerExecutionRole",
framework_version="23.09-py3"
)
Cite this entry
@misc{vaitp:cve20261778,
title = {{Amazon SageMaker SDK disables TLS cert validation for Triton model imports.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-1778},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-1778/}}
}
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 ::
