GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • xdrlib — Encode and decode XDR data
  • Extending and Embedding the Python Interpreter
  • Report a bug
  • Improve this page
  • Show source
  • index
  • modules
  • Python
  • 3.15.2 documentation
  • The Python standard library
  • Security Considerations

This view

  • Original page
  • New address

GeezerVison is showing docs.python.org — Security Considerations

Security Considerations¶

The following modules have specific security considerations:

  • base64: base64 security considerations in RFC 4648

  • hashlib: all constructors take a “usedforsecurity” keyword-only argument disabling known insecure and blocked algorithms

  • http.server is not suitable for production use, only implementing basic security checks. See the security considerations.

  • logging: Logging configuration uses eval()

  • multiprocessing: Connection.recv() uses pickle

  • pickle: Restricting globals in pickle

  • random shouldn’t be used for security purposes, use secrets instead

  • shelve: shelve is based on pickle and thus unsuitable for dealing with untrusted sources

  • ssl: SSL/TLS security considerations

  • subprocess: Subprocess security considerations

  • tempfile: mktemp is deprecated due to vulnerability to race conditions

  • xml: XML security

  • zipfile: 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.

© Copyright 2001 Python Software Foundation.
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 12, 2026 (08:53 UTC). Found a bug?
Created using Sphinx 9.1.1.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.