[medium] semgrep: Allocation of resources without limits or throttling #890

Closed
opened 2026-11-05 16:54:55 +00:00 by pruefwerk · 3 comments
Member

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:

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

## 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)
pruefwerk added the severity:mediumcra:annex-ipruefwerk labels 2026-11-05 16:54:56 +00:00
Author
Member

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.
Author
Member

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.
Author
Member

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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/pruefwerk#890