Navigation
- index
- modules |
- next |
- previous |
- Python »
- 3.16.0a2 documentation »
- The Python standard library »
- Security Considerations
- |
- Theme |
Security Considerations¶
The following modules have specific security considerations:
hashlib: all constructors take a “usedforsecurity” keyword-only argument disabling known insecure and blocked algorithmshttp.serveris not suitable for production use, only implementing basic security checks. See the security considerations.randomshouldn’t be used for security purposes, usesecretsinsteadshelve: shelve is based on pickle and thus unsuitable for dealing with untrusted sourcestempfile: mktemp is deprecated due to vulnerability to race conditionszipfile: maliciously prepared .zip files can cause disk volume exhaustion
The -I command line option can be used to run Python in isolated
mode. When it cannot be used, the -P option or the
PYTHONSAFEPATH environment variable can be used to not prepend a
potentially unsafe path to sys.path such as the current directory, the
script’s directory or an empty string.
Previous topic
xdrlib — Encode and decode XDR data
Next topic
Extending and Embedding the Python Interpreter
This page
«Navigation
- index
- modules |
- next |
- previous |
- Python »
- 3.16.0a2 documentation »
- The Python standard library »
- Security Considerations
- |
- Theme |
This page is licensed under the Python Software Foundation License Version 2.
Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
See History and License for more information.
The Python Software Foundation is a non-profit corporation. Please donate.
Last updated on Nov 29, 2026 (04:54 UTC). Found a bug?
Created using Sphinx 9.1.1.