[medium] semgrep: Improper neutralization of special elements used in an OS Command ('OS Command Injection') #888

Closed
opened 2026-11-05 16:54:53 +00:00 by pruefwerk · 1 comment
Member

medium Finding

Scanner: semgrep
Severity: medium
Rule: gitlab-python_exec_rule-subprocess-call
CWE: CWE-78
CRA: cra-ai-20 — Automatisierte Sicherheitstests (Annex I)

Description

Python possesses many mechanisms to invoke an external executable. However,
doing so may present a security issue if appropriate care is not taken to
sanitize any user provided or variable input. This plugin test is part of a
family of tests built to check for process spawning and warn appropriately.
Specifically, this test looks for the spawning of a subprocess without the
use of a command shell. This type of subprocess invocation is not
vulnerable to shell injection attacks, but care should still be taken to
ensure validity of input.

Location

File: compliance-agent/rules/cra_semgrep.py (line 14)

Code

subprocess.call(["rotate-key", "--id", key_id])

Remediation


Fingerprint: 8f95dd4201481ea9099b739ac469d42dffd00d94d6e3f91bb642597195d87041
Generated by compliance-scanner
Open in Prüfwerk / In Prüfwerk öffnen

## medium Finding **Scanner:** semgrep **Severity:** medium **Rule:** gitlab-python_exec_rule-subprocess-call **CWE:** CWE-78 **CRA:** cra-ai-20 — Automatisierte Sicherheitstests (Annex I) ### Description Python possesses many mechanisms to invoke an external executable. However, doing so may present a security issue if appropriate care is not taken to sanitize any user provided or variable input. This plugin test is part of a family of tests built to check for process spawning and warn appropriately. Specifically, this test looks for the spawning of a subprocess without the use of a command shell. This type of subprocess invocation is not vulnerable to shell injection attacks, but care should still be taken to ensure validity of input. ### Location **File:** `compliance-agent/rules/cra_semgrep.py` (line 14) ### Code ``` subprocess.call(["rotate-key", "--id", key_id]) ``` ### Remediation --- *Fingerprint:* `8f95dd4201481ea9099b739ac469d42dffd00d94d6e3f91bb642597195d87041` *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:53 +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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/pruefwerk#888