Python

Python

Made by DeepSource
Audit required: Insecure cipher BAN-W1004
Security
Major

Cipher used is not secure. It is recommended to replace with a known secure cipher such as AES.

Audit required: Insecure hash function BAN-W1003
Security
Major

D2, MD4, MD5, SHA1 signature algorithms are known to be vulnerable to collision attacks. Attackers can exploit this to generate another certificate with the same digital signature, allowing them to masquerade as the affected service.

Detected calls to FTP-related functions BAN-B321
Security
Major

FTP-related functions are being called. FTP is considered insecure. Use SSH/SFTP/SCP or some other encrypted protocol.

Insecure xmlrpclib import detected BAN-B411
Security
Major

XMLRPC is particularly dangerous as it is also concerned with communicating data over a network. Use defused.xmlrpc.monkey_patch() function to monkey-patch xmlrpclib and mitigate remote XML attacks.

Starting a process with a shell detected BAN-B605
Security
Major

Spawning of a subprocess using a command shell is dangerous as it is vulnerable to various shell injection attacks. Great care should be taken to sanitize all input in order to mitigate this risk. Calls of this type are identified by the use of certain commands which are known to use shells.

Use of _create_unverified_context detected BAN-B323
Security
Major

By default, Python will create a secure, verified ssl context for use in such classes as HTTPSConnection. However, it still allows using an insecure context via the _create_unverified_context that reverts to the previous behavior that does not validate certificates or perform hostname checks. It is recommended to replace this call with the default HTTPS context.

Audit: Binding to all interfaces detected with hardcoded values BAN-B104
Security
Major

Binding to all network interfaces can potentially open up a service to traffic on unintended interfaces, that may not be properly documented or secured. This can be prevented by changing the code so it explicitly only allows access from localhost.

Audit required: Potential SQL injection on RawSQL function BAN-B611
Security
Minor

Use of extra in Django querysets should be audited, since unsanitized strings can open up security vulnerabilities.

Use of insecure input method detected PTC-W1002
Security
Critical

The input method in Python 2 will read from standard input, evaluate and run the resulting string as python source code. This is similar, though in many ways worse, than using eval. On Python 2, use raw_input instead, input is safe in Python 3.

Unsafe parameter given to subprocess.Popen PYL-W1509
Security
Major

The preexec_fn parameter is not safe to use in the presence of threads in your application. The child process could deadlock before exec is called. If you must use it, keep it trivial. Minimize the number of libraries you call into. Ref: https://docs.python.org/3/library/subprocess.html#popen-constructor

Audit required: Use of marshal module BAN-B302
Security
Major

The marshal module is not intended to be secure against erroneous or maliciously constructed data. Never unmarshal data received from an untrusted or unauthenticated source.

Audit required: Possible wildcard injection in call: subprocess.Popen BAN-B609
Security
Major

The use of partially qualified paths may result in unintended consequences if an unexpected file or symlink is placed into the path location given. This becomes particularly dangerous when combined with commands used to manipulate file permissions or copy data off of a system.