[medium] semgrep: Request input is written into the response without encoding, so a crafted link runs script in the user's browser… #886

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

medium Finding

Scanner: semgrep
Severity: medium
Rule: cra-ai-20-node-reflected-input
CWE: CWE-79

Description

Request input is written into the response without encoding, so a crafted link runs script in the user's browser (reflected XSS, CWE-79). Encode it, or use a template engine that escapes by default.

Location

File: compliance-agent/rules/cra_semgrep.js (line 9)

Code

    res.send("<p>Exported for " + req.query.customer + "</p>" + stdout);

Remediation

None; if this file is ever executed as app code, escape req.query.customer before rendering.


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

## medium Finding **Scanner:** semgrep **Severity:** medium **Rule:** cra-ai-20-node-reflected-input **CWE:** CWE-79 ### Description Request input is written into the response without encoding, so a crafted link runs script in the user's browser (reflected XSS, CWE-79). Encode it, or use a template engine that escapes by default. ### Location **File:** `compliance-agent/rules/cra_semgrep.js` (line 9) ### Code ``` res.send("<p>Exported for " + req.query.customer + "</p>" + stdout); ``` ### Remediation None; if this file is ever executed as app code, escape req.query.customer before rendering. --- *Fingerprint:* `e8876c0eea6cf7eeeaee98b1b7f2506413dd05c615072925af373b25b50d70d4` *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:49 +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#886