Scanner: semgrep Severity: medium Rule: gitlab-python_requests_rule-request-without-timeout CWE: CWE-770
Description
The application was found using the requests module without configuring a timeout value for
connections. This could lead to uncontrolled resource consumption where the application could
run out of
socket descriptors, effectively causing a Denial of Service (DoS).
To remediate this issue, pass in a timeout= argument to each requests call.
Example using a timeout for an HTTP GET request:
# Issue a GET request to https://example.com with a timeout of 10 seconds
response = requests.get('https://example.com', timeout=10)
# Work with the response object
# ...
For more information on using the requests module see:
## medium Finding
**Scanner:** semgrep
**Severity:** medium
**Rule:** gitlab-python_requests_rule-request-without-timeout
**CWE:** CWE-770
### Description
The application was found using the `requests` module without configuring a timeout value for
connections. This could lead to uncontrolled resource consumption where the application could
run out of
socket descriptors, effectively causing a Denial of Service (DoS).
To remediate this issue, pass in a `timeout=` argument to each `requests` call.
Example using a timeout for an HTTP GET request:
```
# Issue a GET request to https://example.com with a timeout of 10 seconds
response = requests.get('https://example.com', timeout=10)
# Work with the response object
# ...
```
For more information on using the requests module see:
- https://requests.readthedocs.io/en/latest/api/
### Location
**File:** `compliance-agent/rules/cra_semgrep.py` (line 41)
### Code
```
requests.get("http://api.internal.example/" + path)
```
### Remediation
No action; exclude fixture from SAST scope if appropriate.
---
*Fingerprint:* `5f54b5d82fd65be3dd15f293f68fa764c1ac794fd6e6e0f90c115f904ee98ce6`
*Generated by compliance-scanner*
[Open in Prüfwerk / In Prüfwerk öffnen](https://pruefwerk.breakpilot.com/findings?target=6ae9aa2160f5d8045fc570a7)
Prüfwerk: Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
**Prüfwerk:** Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
Prüfwerk: Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
**Prüfwerk:** Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
Prüfwerk: Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
**Prüfwerk:** Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
medium Finding
Scanner: semgrep
Severity: medium
Rule: gitlab-python_requests_rule-request-without-timeout
CWE: CWE-770
Description
The application was found using the
requestsmodule without configuring a timeout value forconnections. This could lead to uncontrolled resource consumption where the application could
run out of
socket descriptors, effectively causing a Denial of Service (DoS).
To remediate this issue, pass in a
timeout=argument to eachrequestscall.Example using a timeout for an HTTP GET request:
For more information on using the requests module see:
Location
File:
compliance-agent/rules/cra_semgrep.py(line 41)Code
Remediation
No action; exclude fixture from SAST scope if appropriate.
Fingerprint:
5f54b5d82fd65be3dd15f293f68fa764c1ac794fd6e6e0f90c115f904ee98ce6Generated by compliance-scanner
Open in Prüfwerk / In Prüfwerk öffnen
Prüfwerk: Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
Prüfwerk: Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
Prüfwerk: Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.