fix: use safe deserialization in pickle.py#150371
Conversation
Automated security fix generated by OrbisAI Security
The pickle module provides a CLI interface (python -m pickle) that deserializes arbitrary pickle data without any restrictions
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
@python/organization-owners I assume that this account is an automated account as they opened duplicate PRs and would like you to block them as to avoid such future contributions. TiA. |
|
Hi, I’m sorry for the noise. I opened duplicate/low-quality PRs and incorrectly framed documented pickle behaviour as a CPython security fix. I won’t open further duplicate or automated PRs against CPython, and I’ll make sure any future contribution is reviewed, project-specific, and aligned with CPython’s contribution process before opening it. Apologies again for wasting reviewer's time. |
Summary
Fix critical severity security issue in
Lib/pickle.py.Vulnerability
V-005Lib/pickle.py:1938Description: The pickle module provides a CLI interface (python -m pickle) that deserializes arbitrary pickle data without any restrictions. Python's pickle deserialization is inherently unsafe as it can execute arbitrary code through reduce methods. When invoked via the CLI, untrusted pickle data from stdin or file arguments is deserialized without any restrictions on what classes can be instantiated, allowing trivial arbitrary code execution.
Changes
Lib/pickle.pyVerification
Security Invariant
Regression test
This test guards against regressions — it's useful independent of the code change above.
Automated security fix by OrbisAI Security