From f0cba6ecd4d176d8dffaf34e3db779d27251dea9 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 13 Jun 2026 05:36:07 +0000 Subject: [PATCH] Fix DOM-based XSS in showToast functions Co-authored-by: arumes31 <114224498+arumes31@users.noreply.github.com> --- .jules/sentinel.md | 5 +++++ cmd/server/templates/admin_management.html | 2 +- cmd/server/templates/excluded.html | 2 +- cmd/server/templates/settings.html | 2 +- cmd/server/templates/whitelist.html | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.jules/sentinel.md b/.jules/sentinel.md index 0bc6dbd..1b6ff7e 100644 --- a/.jules/sentinel.md +++ b/.jules/sentinel.md @@ -31,3 +31,8 @@ **Vulnerability:** CRLF Injection (CWE-93) / Email Content Injection **Learning:** Interpolating untrusted data (like IP addresses, block reasons, or actor names) directly into email headers or the `Subject` line without sanitization allows an attacker to inject CR/LF characters. This can be used to terminate headers prematurely and inject additional headers (e.g., `Bcc`, `Reply-To`) or even replace the entire email body. **Prevention:** Always sanitize any input destined for a network header or a delimited protocol. Using a `strings.NewReplacer("\r", "", "\n", "")` to strip line-break characters ensures that untrusted content remains confined to its intended field and cannot "break out" to inject new headers. + +## 2026-06-13 - [DOM-based XSS in Toast Notifications] +**Vulnerability:** DOM-based Cross-Site Scripting (XSS) (CWE-79) +**Learning:** Using `innerHTML` with string interpolation to dynamically construct HTML elements using untrusted data allows the browser to execute embedded `