marshal — load
Deserialization of Untrusted Data in the marshal Module
The Python marshal module provides a way to serialize and deserialize
Python objects. However, it is important to be aware that malicious data
can be used to attack applications that use the marshal module. For example,
a malicious data could be used to cause the decoder to execute arbitrary code.
Example
| marshal_load.py | |
|---|---|
Example Output
Remediation
To avoid this vulnerability, it is important to only deserialize data from trusted sources. If you are deserializing data from an untrusted source, you should first sanitize the data to remove any potential malicious code.
Default Configuration
See also
New in version 0.1.0