sagemaker is vulnerable to Path Traversal
35
Low Risk
The SDK downloads files from S3 to the local filesystem in several helpers, including Session.download_data, _download_files_under_prefix, the MLflow model artifact downloader, and the local transform job. These helpers build each local destination path by joining the target directory with the S3 object key and write the file without checking that the resolved path stays inside the target directory. An actor who can place objects with crafted keys containing relative path segments in a downloaded S3 prefix can cause files to be written outside the intended directory, resulting in arbitrary file write. The fix adds a validate_path_within_directory helper that canonicalizes paths with os.path.realpath and rejects any destination that escapes the target directory.
You are affected if you are using a version that falls within the vulnerable range and your application downloads S3 objects whose keys can be influenced by an untrusted party.
sagemaker is vulnerable to Path Traversal in versions 1.45.0 - 2.257.3 and 3.0.0 - 3.9.0.
Upgrade the sagemaker library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant