Exploring security in Python modules
In this section, we will cover security in Python modules, reviewing Python functions and modules that developers can use and that could result in security issues.
Python functions with security issues
We will begin by reviewing the security of Python modules and components, where we can highlight the eval
, pickle
, subprocess
, os
, and yaml
modules.
The idea is to explore some Python functions and modules that can create security issues. For each one, we will study the security and explore alternatives to these modules.
For example, Python modules such as pickle
and sub-process
can only be used bearing in mind security and the problems that can appear as a result of their use.
Usually, Python's documentation includes a warning regarding the risks of a module from the security point of view, which looks something like this:
The following...