CVE-2024-3568CWE-502

Arbitrary Code Execution via Deserialization in huggingface/transformers

Low · published April 10, 2024

CVSS v3.0
3.4
EPSS
2%
Percentile
81.4
In the wild
Unconfirmed
What it is

⚠️ A simple yet sneaky flaw lurks in the huggingface/transformers library, allowing arbitrary code execution through deceptively innocent looking data! 🔥 Think of it like a chef who unknowingly accepts a delivery of ingredients with a hidden poison. The `load_repo_checkpoint()` function seems to be preparing a tasty meal, but with untrusted data, that meal could turn toxic! An attacker could craft a malicious serialized payload, tricking users into loading it during a standard training session. Once loaded, the attacker gains the power to execute arbitrary code on the victim's machine, potentially leading to data breaches or complete system compromise. It's low on severity now, but it could become a real headache if not addressed!

Put simply

Think of it like a chef who unknowingly accepts a delivery of ingredients with a hidden poison. The `load_repo_checkpoint()` function seems to be preparing a tasty meal, but with untrusted data, that meal could turn toxic! This vulnerability in the huggingface/transformers library stems from the use of `pickle.load()` on untrusted data within the `load_repo_checkpoint()` function of the `TFPreTrainedModel()` class, which allows attackers to execute code remotely by exploiting deserialization flaws.

What to do

An attacker could craft a malicious serialized payload, tricking users into loading it during a standard training session. Once loaded, the attacker gains the power to execute arbitrary code on the victim's machine, potentially leading to data breaches or complete system compromise. It's low on severity now, but it could become a real headache if not addressed! To mitigate this issue, avoid loading untrusted serialized data and consider switching to safer alternatives like `json.loads()` for serialization. Ensure you update the huggingface/transformers library to its latest version where this issue is fixed, and always validate the source of your data before loading it! You've got this! With a few tweaks, you can secure your environment and keep those malicious payloads at bay! 🛡️

The record
Technical detail
CVSS v3.0
3.4 · LOW
Vector
CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:N/A:L
CVSS v4.0
Not supplied
EPSS
0.02084 · 81.4th percentile
Weakness
CWE-502 · Deserialization of Untrusted Data
Published
2024-04-10T17:07Z
EPSS history
Timeline
  • 10 APR 17:07Z
    Arbitrary Code Execution via Deserialization in huggingface/transformers
    cvelistv5