This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author joker
Recipients joker
Date 2021-07-28.06:37:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1627454244.04.0.843143587148.issue44757@roundup.psfhosted.org>
In-reply-to
Content
There are a number of techniques for reading external files and loading their content into (de/serializing) Python objects. Pickle is one such powerful serialization technique that is inherently risky, especially when an attacker tampers with serialized data.

Data from external sources is never secure. As a rule of thumb, never unpickle or parse data from an untrusted source into Python objects. This is because an attacker can use a subprocess module to execute arbitrary commands during pickling.

Additionally, YAML files from user input can leave your application open to attacks. To avoid this, use PyYAML safe_loadfunction (yaml.safe_load) to handle YAML serialization.

Here is a simple custom code that can be used to find all unsafe yaml.load functions in your codebase.
History
Date User Action Args
2021-07-28 06:37:24jokersetrecipients: + joker
2021-07-28 06:37:24jokersetmessageid: <1627454244.04.0.843143587148.issue44757@roundup.psfhosted.org>
2021-07-28 06:37:24jokerlinkissue44757 messages
2021-07-28 06:37:23jokercreate