pickle — load
Deserialization of Untrusted Data in pickle Module
The Python pickle module is a serialization module that can be used to
serialize and deserialize Python objects. However, pickle is not a secure
serialization format and should not be used to serialize sensitive data.
Pickle is not secure because it can be used to deserialize malicious code. For example, an attacker could create a pickle file that contains malicious code and then trick a user into opening the file. When the user opens the file, the malicious code would be executed.
Example
Example Output
Remediation
Consider signing data with hmac if you need to ensure that pickle data has not been tampered with.
Alternatively if you need to serialize sensitive data, you could use a secure serialization format, such as JSON or XML. These formats are designed to be secure and cannot be used to execute malicious code.
Default Configuration
See also
Info
New in version 0.1.0