Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-57845-hf-datasets-rce — Proof-of-concept and patch for CVE-2026-57845: pickle deserialization RCE in Hugging Face datasets' pandas builder, with reproduction script and remediation guidance. | Kitploit
Tools/GitHubGitHub/saiteja-erukude/cve-2026-57845-hf-datasets-rce
Vulnerability AnalysisCode AnalysisExploitationSupply Chain SecurityPapers & ResearchAI Security
GitHubsaiteja-erukude/cve-2026-57845-hf-datasets-rce

CVE-2026-57845-hf-datasets-rce

Proof-of-concept and patch for CVE-2026-57845: pickle deserialization RCE in Hugging Face datasets' pandas builder, with reproduction script and remediation guidance.

View Repository
28 days agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    968
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    556
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    347
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    346
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    319
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    297

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-57845: Hugging Face datasets <= 5.1.0 Pandas Pickle RCE

Severity: High, CVSS 3.1 8.8

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Affected: all Hugging Face datasets versions <= 5.1.0

Component: datasets.packaged_modules.pandas.pandas

CWE: CWE-502 (Deserialization of Untrusted Data)

Discovered and reported by: Sai Teja Erukude


Summary

Hugging Face datasets versions up to and including 5.1.0 allow arbitrary Python code execution when loading attacker-controlled pickle files through the deprecated but still registered pandas packaged builder.

The builder resolves caller-supplied data_files, opens each file as bytes, and passes the file object directly to pandas.read_pickle() before converting the result to an Arrow table:

with open(file, "rb") as f:
    pa_table = pa.Table.from_pandas(pd.read_pickle(f))

Python pickle deserialization can execute attacker-selected code. When a victim loads a malicious pickle-backed dataset with datasets.load_dataset("pandas", data_files=...), the payload executes with the victim process's privileges before Arrow conversion or feature validation.

Impact

An attacker who can cause a victim to load an attacker-controlled pickle through the pandas builder may execute arbitrary Python code in the victim process.

This can affect data analysis, machine learning, and automation workflows that load datasets from untrusted projects, repositories, downloads, or shared files. The attacker does not need privileges in the victim environment, but the victim must load the malicious dataset, consistent with the report's user-interaction requirement (UI:R).

Depending on the local environment, this may allow:

  • Reading files, environment variables, and application secrets accessible to the process.
  • Modifying files or data used by the victim's workflow.
  • Running Python operations or local programs with the process's privileges.
  • Disrupting data processing or exhausting available resources.

Technical Detail

The vulnerable path is the pandas packaged builder:

datasets.load_dataset("pandas", data_files=...)
  -> dataset_module_factory(...)
  -> registered pandas packaged builder
  -> Pandas._split_generators(...)
  -> resolve or download caller-supplied data_files
  -> Pandas._generate_tables(...)
  -> open(file, "rb")
  -> pandas.read_pickle(f)
  -> pyarrow.Table.from_pandas(...)

The PoC creates a pickle object whose __reduce__() method specifies a callable that writes a harmless local marker file and returns a valid pandas.DataFrame. During deserialization, that callable executes before the builder converts the returned DataFrame to an Arrow table. Dataset loading then completes normally and returns one row.

The runner invokes the real datasets.load_dataset() API from the installed package. A fresh local cache and removal of the previous marker ensure that the saved result demonstrates execution during dataset loading.

Deprecating the builder or validating the returned DataFrame does not prevent execution during unpickling. The pandas documentation also warns against loading pickle data from untrusted sources.

Proof of Concept

run_poc.py generates attacker-controlled.pkl, loads it through the pandas builder, and records execution evidence.

Run in a local test environment only. To reproduce the version shown in the saved evidence on Windows:

python -m venv .venv
.\.venv\Scripts\python.exe -m pip install "datasets==5.1.0"
.\.venv\Scripts\python.exe -B run_poc.py

The included requirements.txt currently specifies datasets<=5.0.1. It can be installed with python -m pip install -r requirements.txt to test that earlier range, but it does not select the 5.1.0 installation used in the saved evidence. The explicit pin above reproduces that installation's datasets version.

Expected evidence on the demonstrated vulnerable version:

datasets_version: 5.1.0
installed_package: True
load_error: None
row_count: 1
first_row: {'value': 'benign dataframe returned after pickle execution'}
marker_before_load_dataset: False
marker_after_load_dataset: True
marker_contents:
datasets_pandas_pickle_rce_triggered
success: True

The important evidence is that the marker is absent before load_dataset(), appears during loading, and contains the expected string while dataset loading completes successfully and returns the expected row.

The payload's execution effect is a local marker-file write:

datasets_pandas_pickle_rce_triggered

The runner also writes the generated pickle, cache, and evidence files. Each run replaces attacker-controlled.pkl, marker.txt, cache/, and evidence/ in the PoC directory; preserve existing evidence before rerunning it.

Saved artifacts:

  • JSON evidence
  • Execution evidence
  • Demo video

Remediation

The narrow fix replaces the entire body of Pandas._generate_tables() with an unconditional error before any file is opened or passed to pandas.read_pickle():

def _generate_tables(self, files):
    raise ValueError(PANDAS_PICKLE_DISABLED_ERROR)

The error explains the pickle execution risk and directs callers to Parquet, Arrow, CSV, JSON, or Dataset.from_pandas() for an existing DataFrame. This blocks the reported code-execution path for every filename, including trusted pickles; it does not attempt to determine which pickle files are trustworthy.

The builder remains registered and can still be constructed through load_dataset_builder("pandas", ...) or Pandas(...). File resolution and downloads may happen before table generation fails. With streaming, the error occurs when the dataset is iterated. A compatible prepared Arrow cache can still be reused without calling _generate_tables() or unpickling the input. Changing the builder source changes its hash, so older caches may no longer match automatically. This patch does not reject the builder name in load.py.

For example, load Parquet through its dedicated builder:

from datasets import load_dataset

dataset = load_dataset("parquet", data_files="data.parquet", split="train")

Regression tests cover fresh loading, streaming iteration, direct table generation, builder construction, prepared Arrow cache reuse, and supported replacement formats. They verify that pandas.read_pickle() is never reached and that direct table generation does not open files. Checking an object's type after unpickling is too late. Renaming a file, emitting a warning, or converting an untrusted pickle to another format by first unpickling it does not address the execution risk.

See fix.md for the narrow patch, migration guidance, and verification commands. The patch is applied to this checkout's source; existing installed packages must be patched or replaced separately. This repository links the related upstream pull request below; a confirmed fixed release is not documented here.

Credit

Discovered and reported by Sai Teja Erukude.

Disclosure was coordinated through VulnCheck.

References

Download Tool