2 ms·
Well, like eval(), it's only a security issue if you're reading pickled files from untrusted sources (that is, anywhere an attacker could have modified them). I
by icebraining 9y ago
Well, like eval(), it's only a security issue if you're reading pickled files from untrusted sources (that is, anywhere an attacker could have modified them). If you just ship them along with your Python source files, then it's a moot problem, since the attacker could just edit the source files.
- jamesdutc 9y agoSome environments use code-signing as a security mechanism. Arbitrary execution via pickle creates holes in this mechanism, requiring additional mitigations. PEP-551 briefly discusses security motivations and potential mechanisms for environments where code execution is locked down: https://www.python.org/dev/peps/pep-0551/ https://www.python.org/dev/peps/pep-0551/