[KongchangAI]
Productpickle模块

pickle

A built-in Python standard library module for object serialization. It converts Python objects into byte streams for persistent storage and supports most built-in Python types. It serves as the most fundamental serialization tool in the Python ecosystem.

Core Facts

Timeline (last 90 days)

Oct 14

Model weight files may be implanted with malicious code, for example executing arbitrary commands through pickle deserialization vulnerabilities.

Unverified50%
Oct 12

pickle is a Python built-in standard library used to serialize most Python objects, but it is slow when handling large numpy arrays and is unsuitable for big data scenarios.

Unverified50%
Oct 12

pickle implements serialization by converting Python objects into a byte stream, a process called pickling, with the reverse recovery called unpickling.

Unverified50%
Oct 12

If a model internally contains large numpy arrays (as is common with scikit-learn models), joblib has advantages over pickle in both speed and reliability.

Unverified50%
Oct 8

A large number of existing models are still distributed in pickle format (.pkl, .pt, .bin), making static scanning before ingestion (e.g., with the picklescan tool) a necessary line of defense.

Unverified50%
Sep 25

For platforms such as Hugging Face, attacks have been historically documented in which arbitrary code execution is triggered during model loading via malicious pickle files.

Unverified60%
Sep 11

Hugging Face supports using the safetensors format as a replacement for the pickle format.

Unverified50%
Sep 11

Prioritizing safetensors over pickle format when loading models can eliminate the risk of deserialization code execution at the source.

Unverified50%

All Facts (12)

Verified

Python's pickle format can execute arbitrary code during deserialization, allowing attackers to embed malicious code in model files.

80%
Unverified

For platforms such as Hugging Face, attacks have been historically documented in which arbitrary code execution is triggered during model loading via malicious pickle files.

60%
Unverified

Model weight files may be implanted with malicious code, for example executing arbitrary commands through pickle deserialization vulnerabilities.

50%
Unverified

pickle is a Python built-in standard library used to serialize most Python objects, but it is slow when handling large numpy arrays and is unsuitable for big data scenarios.

50%
Unverified

If a model internally contains large numpy arrays (as is common with scikit-learn models), joblib has advantages over pickle in both speed and reliability.

50%
Unverified

pickle implements serialization by converting Python objects into a byte stream, a process called pickling, with the reverse recovery called unpickling.

50%
Unverified

A large number of existing models are still distributed in pickle format (.pkl, .pt, .bin), making static scanning before ingestion (e.g., with the picklescan tool) a necessary line of defense.

50%
Unverified

Prioritizing safetensors over pickle format when loading models can eliminate the risk of deserialization code execution at the source.

50%
Unverified

Hugging Face supports using the safetensors format as a replacement for the pickle format.

50%
Unverified

PyTorch的.pt/.pth文件和许多框架的checkpoint依赖pickle进行序列化存储

50%
Unverified

应使用安全的序列化格式如safetensors而非pickle,并对拉取的模型进行完整性校验

50%
Unverified

The deep learning community has long shared model weights in pickle format (.pt, .pkl files), and safer formats such as safetensors are being promoted as replacements.

50%

Source Articles