Intel

AIKIDO-2026-285573

huggingface-hub is vulnerable to Insecure Deserialization

Insecure Deserialization Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 2 days ago

88

High Risk

This Affects:

PYTHONhuggingface-hub
0.27.0 - 1.31.0
Fixed in 1.32.0
Are you affected? Scan for Free

TL;DR

serialization/_torch.py loads Torch checkpoint files through pickle based deserialization without restricting the objects that get unpickled by default. A checkpoint file from a source that is not fully trusted can embed pickle opcodes that execute code as soon as the checkpoint is loaded. The loader also skips validating certain shard/index values before loading, letting a crafted checkpoint reach an unsafe combination of loading options. The fix switches the default to safe/restricted loading, validates the indexes, and rejects unsafe option combinations.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you load a Torch checkpoint file that did not originate from a source you fully trust.

Background info

huggingface-hub is vulnerable to Insecure Deserialization in versions 0.27.0 - 1.31.0.

How to fix this

Upgrade the huggingface-hub library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform