From 45e40b57bb0868743f05be8def510588db5fb95d Mon Sep 17 00:00:00 2001 From: faber Date: Tue, 14 Jul 2026 10:59:04 -0400 Subject: [PATCH] fix: block stale OAuth exchange in local-only mode --- index.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.html b/index.html index f774b18..3414acc 100644 --- a/index.html +++ b/index.html @@ -4718,6 +4718,14 @@ RESPOND WITH EXACTLY ONE LINE. No explanation, no preamble.`; const cleanUrl = window.location.origin + window.location.pathname; window.history.replaceState({}, '', cleanUrl); + // A stale OAuth callback must never re-enable a cloud request while + // strict local-only mode is active. + if (state.localOnly) { + sessionStorage.removeItem('or_code_verifier'); + sessionStorage.removeItem('or_callback_url'); + return false; + } + const codeVerifier = sessionStorage.getItem('or_code_verifier'); if (!codeVerifier) { console.warn('[OAuth] Got code but no verifier in session — stale callback?');