Showing all detectors for the Python language with medium severity.

Resource leak

Allocated resources are not released properly.

Inefficient string concatenation inside loop

Inefficient string concatenation inside loops results in new object creation which adds quadratic runtime cost.

Integer overflow

An integer overflow might might cause security issues when it is used for resource management or execution control.

Catch and rethrow exception

Catching and re-throwing an exception without further actions is redundant and wasteful.

Time zone aware datetimes

Using naive datetime objects might cause time zone related issues.

Improper input validation

Improper input validation can enable attacks and lead to unwanted behavior.

Catch and swallow exception

Swallowing exceptions, without re-throwing or logging them, is a bad practice.

Missing none check on response metadata

Response metadata was not checked to verify that it is not None.

Using AutoAddPolicy or WarningPolicy

Using AutoAddPolicy or WarningPolicy can allow a malicious server to impersonate a trusted server.

Stack trace exposure

Stack traces can be hard to use for debugging.

Use of a deprecated method

This code uses deprecated methods, which suggests that it has not been recently reviewed or maintained.

Mutable objects as default arguments of functions

Default values in Python are created exactly once, when the function is defined. If that object is changed, subsequent calls to the function will refer to the changed object, leading to confusion.

Insecure temporary file or directory

Insecure ways of creating temporary files and directories can lead to race conditions, privilege escalation, and other security vulnerabilities.

Untrusted AMI images

Improper filtering of Amazon Machine Images (AMIs) can result in loading an untrusted image, a potential security vulnerability.

AWS client not reused in a Lambda function

Recreating AWS clients in each Lambda function invocation is expensive.

Confusion between equality and identity in conditional expression

Confusion between equality ==, != and identity is in conditional expressions can lead to unintended behavior.

Dangerous global variables

Global variables can be dangerous and cause bugs because they can be simultaneously accessed from multiple sections of a program.

Enabling and overriding debug feature

The Debug feature should not be enabled or overridden.

Risky use of dict get method

Using the get method from the dict class without default values can cause runtime exceptions.

Multiple values in return statement is prone to error

Methods that return multiple values can be difficult to read and prone to error.

Batch request with unchecked failures

Not checking which items have failed can lead to loss of data.

Bad exception handling

Throwing a base or generic exception might cause important error information to be lost. This can make your code difficult to maintain.

Docker arbitrary container run

Passing an unsanitized user argument to a function call makes your code insecure.

Hardcoded IP address

Hardcoding an IP address can cause security problems.

Insecure CORS policy

Cross-Origin Resource Sharing policies that are too permissive may lead to security vulnerabilities.