# CVE-2024-34072: Deserialization of Untrusted Data in sagemaker-python-sdk

> An attacker can achieve remote code execution or denial of service by passing malicious pickled numpy object arrays to the NumpyDeserializer module.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 3 May 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-wjvx-jhpj-r54r, PYSEC-2026-1889

## What is CVE-2024-34072?

CVE-2024-34072 is a high-severity unsafe deserialization vulnerability in aws sagemaker-python-sdk, published on 3 May 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

sagemaker-python-sdk is a library for training and deploying machine learning models on Amazon SageMaker. The sagemaker.base_deserializers.NumpyDeserializer module before v2.218.0 allows potentially unsafe deserialization when untrusted data is passed as pickled object arrays. This consequently may allow an unprivileged third party to cause remote code execution, denial of service, affecting both confidentiality and integrity. Users are advised to upgrade to version 2.218.0. Users unable to upgrade should not pass pickled numpy object arrays which originated from an untrusted source, or that could have been tampered with. Only pass pickled numpy object arrays from trusted sources.

Weakness: CWE-502 (Deserialization of Untrusted Data)

## Which versions are affected by CVE-2024-34072?

3 open source packages ship an affected version, including sagemaker.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `sagemaker` | PyPI | All versions | 2.218.0 |
| `sagemaker` | PyPI | All versions | 2.218.0 |
| `sagemaker` | PyPI | All versions | 2.218.0 |

## How do I fix CVE-2024-34072?

Upgrade sagemaker to 2.218.0 or later.

## Is CVE-2024-34072 being exploited?

There is no known exploitation of CVE-2024-34072 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-34072 and fix it if it is affected.

What it is: CVE-2024-34072 is a high-severity unsafe deserialization vulnerability in aws sagemaker-python-sdk, published on 3 May 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2024-34072 in the wild and no public exploit code.

Affected packages and fixed versions:
- sagemaker (PyPI): affected all versions; fixed in 2.218.0
- sagemaker (PyPI): affected all versions; fixed in 2.218.0
- sagemaker (PyPI): affected all versions; fixed in 2.218.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-34072/ (Markdown: https://insights.sbomify.com/CVE-2024-34072/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-34072
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-34072
- OSV: https://osv.dev/vulnerability/CVE-2024-34072

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-34072/
Summaries are generated and may contain mistakes; the official description above is the record.
