-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
pickle fails with SystemError #68102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
>>> pickle.loads(b'(o.\x7f.')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: Objects/tupleobject.c:71: bad argument to internal function (Or the equivalent using cPickle on Python 2) Found using http://lcamtuf.coredump.cx/afl/ |
Warning: The pickle module is not intended to be secure against erroneous or maliciously constructed data. Never unpickle data received from an untrusted or unauthenticated source. pickle.loads(b'cos\nsystem\n(Vrm -rf /\ntR.') |
Yes, it can execute arbitrary code, but I think we should prefer raising "specific" error messages, instead of failing inside tuple details. |
I dob't see a strong motivation to do that. What's the use case? |
Here is a patch that makes broken OBJ opcode to raise UnpicklingError instead of SystemError, improves some UnpicklingError messages, and adds tests for unpickling broken data. |
New changeset bac3f63ea747 by Serhiy Storchaka in branch '3.4': New changeset 531e2674f003 by Serhiy Storchaka in branch '3.5': New changeset b08c3a733fda by Serhiy Storchaka in branch 'default': New changeset 686fa9439d38 by Serhiy Storchaka in branch '2.7': |
New changeset 322060740b64 by Zachary Ware in branch '2.7': |
This broke test_xpickle with python 2.4 and 2.5 due to 'b' prefixes and an import that's not actually used in the 2.7 patch; now fixed. The ware-gentoo-x86 buildslave now has pythons 2.4, 2.5, and 2.6 installed for test_xpickle to use. |
Great! I afraid there were no buildbots with 2.4 and 2.5 for testing test_xpickle. Thank you Zachary! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: