00->1
← All hunts

SageMaker Credential Leak: CVE-2026-110248

Target: aws/sagemaker-python-sdk, specifically git_utils.py, the module behind SageMaker's Git integration for pulling training and serving code from a repository you point it at.

A quick note for anyone who hasn't used it, or hasn't used AWS at all: Amazon Web Services (AWS) is Amazon's cloud platform, it rents out servers, storage and other computing infrastructure over the internet so companies don't have to buy and run their own hardware. Amazon SageMaker is AWS's managed service for training and running machine learning models on top of that infrastructure, it provisions the servers and GPUs for you so you don't have to manage them yourself. The SageMaker Python SDK is the official library people use to control it from Python: a few lines of code say which script to run, where the training code lives, and what hardware to run it on, and the SDK handles the rest on AWS's side.

One of the things it handles is fetching your training code straight from a Git repository. SageMaker lets a training job clone from a private repo if you pass a token, or a username and password, through git_config. I started reading how the SDK actually builds that clone command, and the credential handling on the failure path turned out to be broken.

How it breaks

git_utils.py does three things in order. First it runs the repo URL through _sanitize_git_url(), a function whose whole job is making sure the URL is safe to use and safe to show. Then, after that check has already run, it splices your token (or username and password) into the URL to build the real HTTPS clone target. Finally it hands that URL to subprocess.check_call(["git", "clone", repo_url, dest_dir]).

The sanitizer runs before the credential gets added, not after. By the time the credential is sitting in the URL, nothing is checking it anymore.

subprocess.check_call raises CalledProcessError on a non zero exit, and that exception carries the exact argument list it was given in its .cmd attribute, URL included. The HTTPS clone path in git_utils.py had no try/except around that call. So any failed clone, a bad token, a typo, an expired credential, a renamed repo, even just a flaky network, raised an unhandled exception with the live credential sitting in plaintext inside it.

SageMaker streams all training job output, including full Python tracebacks, into CloudWatch Logs by default, CloudWatch Logs being AWS's own logging service, where most AWS accounts keep the output of everything that runs. That's not a misconfiguration, it's how the platform is meant to work. So the credential didn't stay on some ephemeral container. It landed in a durable, centrally stored log group that anyone with read access to that log group, any user or role the account owner has permitted to view logs, could read straight out of. A leaked GitHub token hands over read/write access to the repo it's scoped to, and sometimes broader org access depending on scope.

Proof

No SageMaker job needed. The bug lives entirely in how subprocess reports a failure, so it reproduces in two lines:

import subprocess

# Mirrors exactly what git_utils.py does: a clean URL,
# with a credential spliced in right before the clone call.
url = "https://myuser:ghp_SuperSecretToken123@github.com/nonexistent/repo-xyz"

try:
    subprocess.check_call(["git", "clone", url, "/tmp/test_leak"])
except subprocess.CalledProcessError as e:
    print(" ".join(e.cmd))

Run it. The clone fails because the repo doesn't exist, and the except block prints the token back out in full:

git clone https://myuser:ghp_SuperSecretToken123@github.com/nonexistent/repo-xyz /tmp/test_leak

That is the exact string that would have landed in CloudWatch Logs from a real training job hitting a real clone failure. No special tooling, no race condition, no privilege escalation needed to cause it. Just a token that stopped working.

The fix

AWS Security's email confirming the CVE, GHSA and security bulletin were published for this report

I reported this to the AWS Security team and worked with them to get it patched. The fix, merged into both the current (V3) and legacy (V2) branches, wraps the clone call in a proper try/except.

AWS assigned CVE-2026-110248 (CWE-532, Insertion of Sensitive Information into a Log File), CVSS 3.1 score 5.3 Moderate, and published it as GHSA-g6w4-jvgp-68x2 and AWS Security Bulletin AWS-2026-134. It's fixed in SageMaker Python SDK V2 2.257.3 and V3 3.10.0.

AWS credited the finding to me in the bulletin and the advisory. It's not a flashy bug. It's a three line oversight in a widely used SDK, and the only thing it needed to go wrong was a clone that failed, which happens to everyone eventually.