Skip to content

Insecure Request Timeout

Description

The application uses the `requests` module without configuring a timeout value for connections, which could lead to uncontrolled resource consumption and a Denial of Service (DoS).

Examples

Insecure Code

python
response = requests.get('https://example.com')

Secure Code

python
response = requests.get('https://example.com', timeout=10)

Remediation

Pass in a `timeout=` argument to each `requests` call.

Rule Details

FieldValue
IDCODE-0159
CategoryInsecureConfig
SeverityMEDIUM
CWECWE-770
ConfidenceHIGH
ImpactMEDIUM
LikelihoodMEDIUM
ExploitabilityEASY
TagsDenial of Service, DoS
OWASPA6:2017-Security Misconfiguration, A05:2021-Security Misconfiguration