From bc3b71133752184225778113eecbcab6988db37e Mon Sep 17 00:00:00 2001 From: anupamme Date: Fri, 18 Sep 2026 12:16:10 +0000 Subject: [PATCH] fix: multi_agent.cwe-287 security vulnerability Automated security fix generated by OrbisAI Security --- api/report.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/api/report.php b/api/report.php index 78b731d..a19ebda 100644 --- a/api/report.php +++ b/api/report.php @@ -53,6 +53,17 @@ exit; } +// Session-basierte Rate-Begrenzung: verhindert Missbrauch des unauthentifizierten +// Endpunkts durch automatisierte/wiederholte Anfragen (z. B. Mail-Relay-Spam). +session_start(); +$rate_limit_seconds = 30; +if (!empty($_SESSION['ap_report_last']) && (time() - (int)$_SESSION['ap_report_last']) < $rate_limit_seconds) { + http_response_code(429); + echo json_encode(['success' => false, 'error' => 'Zu viele Anfragen. Bitte warte kurz und versuche es erneut.']); + exit; +} +$_SESSION['ap_report_last'] = time(); + // Pflichtfeld Feedback prüfen $feedback = trim((string)($data['feedback'] ?? '')); if (empty($feedback)) {