From e185e4a54dd0c64feffd204d1bd0fa0c8e43a73e Mon Sep 17 00:00:00 2001
From: seonghobae <8172694+seonghobae@users.noreply.github.com>
Date: Thu, 30 Jul 2026 13:43:29 +0000
Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A1=EF=B8=8F=20Sentinel:=20[security?=
=?UTF-8?q?=20improvement]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
๐จ Severity: MEDIUM
๐ก Vulnerability: CSP `base-uri 'self'` allows base tag injection if attacker hosts resources on same-origin.
๐ฏ Impact: Base tag injection can hijack relative URLs across the application.
๐ง Fix: Set `base-uri 'none'` in CSP for index.html as the application does not dynamically manipulate base URLs.
โ
Verification: Ran `pytest tests/test_index_security.py` verifying CSP `base-uri` rule.
---
.jules/sentinel.md | 4 ++++
CHANGELOG.md | 1 +
index.html | 2 +-
tests/test_index_security.py | 19 +++++++++++++++++++
4 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 tests/test_index_security.py
diff --git a/.jules/sentinel.md b/.jules/sentinel.md
index 4f173bc..f30faec 100644
--- a/.jules/sentinel.md
+++ b/.jules/sentinel.md
@@ -38,3 +38,7 @@
**Vulnerability:** Missing input validation on `setLanguage()` could allow invalid strings (like Prototype Pollution payloads or arbitrary text) to be applied to the DOM (`lang` attribute) and stored in `localStorage`.
**Learning:** The global `setLanguage` function assumed inputs would only come from predefined button clicks, skipping runtime validation.
**Prevention:** Always sanitize and validate function arguments at the application boundary, even if the primary caller is trusted, to enforce defense in depth.
+## 2026-07-30 - Fix base-uri injection risk in strict CSP
+**Vulnerability:** The Content Security Policy for the main page allowed `base-uri 'self'`, which could theoretically permit base tag injection if an attacker could upload or craft a same-origin resource, altering relative URL resolutions.
+**Learning:** For static sites that do not explicitly require a `