[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

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 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

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 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.

Unverified50%
Sep 11

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

Unverified50%
Sep 11

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

Unverified50%
Aug 28

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

Unverified50%
Aug 28

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

Unverified50%

3 more timeline events

All Facts (13)

Verified

Python pickle格式在反序列化时可以执行任意代码,攻击者可以在模型文件中嵌入恶意代码

65%
Unverified

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

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 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

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

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.

50%
Unverified

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

50%
Unverified

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

50%
Unverified

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

50%
Unverified

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

50%
Unverified

safetensors等安全格式正在推广作为pickle格式的替代,但大量存量模型仍使用pickle格式

50%
Unverified

深度学习社区长期以pickle格式分享模型权重(.pt、.pkl文件),safetensors等安全格式正在推广以替代

50%

Source Articles