From ac614072fe52452eb42867a9d4bc7608139fd1ac Mon Sep 17 00:00:00 2001 From: Avi Date: Fri, 21 Aug 2026 13:54:52 -0500 Subject: [PATCH] Refresh checkpoint with CSP and navigation guards --- CHECKPOINT-encryption.md | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/CHECKPOINT-encryption.md b/CHECKPOINT-encryption.md index d6fd71d..4f2fe91 100644 --- a/CHECKPOINT-encryption.md +++ b/CHECKPOINT-encryption.md @@ -1,4 +1,4 @@ -# Checkpoint — Upload pick tokens (2026-08-21) +# Checkpoint — Header-based CSP + navigation guards (2026-08-21) A stopping point you can return to if this session is closed. Everything below was verified green at the moment this file was written. @@ -6,12 +6,12 @@ verified green at the moment this file was written. ## Where things are - Project: `/home/avi/Projects/0_Nostr` -- Git repo: `master` @ `6e627a3` ("Replace upload file paths with single-use pick tokens"). - Before it: `4bde395` ("Restrict renderer IPC to an explicit method allowlist"), then - `dafed33` (checkpoint refresh), on top of contact-aware feed (`a1445d1`) etc. +- Git repo: `master` @ `4d4dfde` ("Enforce header-based CSP and block window open/navigation"). + Before it: `6e627a3` (upload pick tokens), `4bde395` (IPC allowlist), then checkpoint + commits, on top of contact-aware feed (`a1445d1`) etc. - Working tree is **clean** apart from this checkpoint update, which is committed right after. -## What was completed: security hardening items #1 and #2 +## What was completed: security hardening items #1, #2 and #3 Fixes from the 2026-08-21 security audit. @@ -39,8 +39,25 @@ page could read+publish arbitrary local files to nostr.build. Now: - Fake backend mirrors the contract: `upload_image` without a non-empty `token` throws an `unknown_token` error, so tests exercise the same protocol rule. +**#3 Header-based CSP + navigation/window guards (`4d4dfde`):** +- The static CSP meta tag was **removed** from `frontend/index.html` and replaced with + response headers stamped by `main.ts` (`onHeadersReceived`, mainFrame only): + - `CSP_PROD` for `app://` pages: `script-src 'self'` — **no `'unsafe-inline'`**, so an + injected `