diff --git a/HANDOFF.md b/HANDOFF.md index bc42e0b..2d80192 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -104,7 +104,7 @@ Against local open-oscar-server 0.25.0 with `DISABLE_AUTH=true`, TOC listener 98 2. **UI polish follow-up:** unread indicators, chat room membership/invite-send UI, better mobile layout. (Tab close/leave for PMs and chat rooms added 2026-12-03.) 3. **Harden TOC client:** handle reconnect/backoff, keepalive timeout, parse CONFIG2 buddy list properly, handle TOC1/TOC2 variants, handle chat errors/room not found. 4. **Chat UX:** show chat room membership, leave button, invite-send UI, better system messages, error states. -5. **Security follow-up:** login target host/ports are validated: localhost/private/reserved IPs and hostnames resolving to them are blocked (`isDisallowedHost`), and Web API/TOC ports must be within +/-5 of configured default ports (`isAllowedPort`) to limit port scanning. Login failures always return generic `login failed` after a minimum 15s delay to reduce timing/oracle abuse. Bot check is basic (scriptable); rely on rate limits and consider stronger CAPTCHA if abuse appears. +5. **Security follow-up:** login target host/ports are validated: localhost/private/reserved IPs and hostnames resolving to them are blocked (`isDisallowedHost`), and Web API/TOC ports must be within +/-5 of configured default ports (`isAllowedPort`) to limit port scanning. Login failures always return generic `login failed` after a minimum 7s delay to reduce timing/oracle abuse. Bot check is basic (scriptable); rely on rate limits and consider stronger CAPTCHA if abuse appears. ## Files of interest diff --git a/public/app.js b/public/app.js index c3c2763..b941e6b 100644 --- a/public/app.js +++ b/public/app.js @@ -6,9 +6,9 @@ // - Dedupe matters because TOC/Web API paths and SSE replay can surface the same message; // we use msgId when present, otherwise a short recent text/from/mine heuristic. // - UI rendering is delegated to js/ui.js; API calls to js/api.js; SSE to js/stream.js. -import { api } from './js/api.js?v=35'; -import { createStream } from './js/stream.js?v=35'; -import * as ui from './js/ui.js?v=35'; +import { api } from './js/api.js?v=36'; +import { createStream } from './js/stream.js?v=36'; +import * as ui from './js/ui.js?v=36'; window.addEventListener('error', (e) => { console.error('[ui] error', e.error || e.message); @@ -341,6 +341,12 @@ async function loadChallenge() { document.getElementById('loginForm').addEventListener('submit', async (e) => { e.preventDefault(); ui.setLoginError(''); + const submitBtn = e.currentTarget.querySelector('.login-submit'); + const originalBtnHtml = submitBtn ? submitBtn.innerHTML : ''; + if (submitBtn) { + submitBtn.disabled = true; + submitBtn.innerHTML = 'Signing in...'; + } const screenName = document.getElementById('screenName').value.trim(); const password = document.getElementById('password').value; const host = document.getElementById('serverHost').value.trim(); @@ -353,6 +359,11 @@ document.getElementById('loginForm').addEventListener('submit', async (e) => { } catch (err) { ui.setLoginError(err.message); loadChallenge().catch(() => {}); + } finally { + if (submitBtn) { + submitBtn.disabled = false; + submitBtn.innerHTML = originalBtnHtml || 'Sign in'; + } } }); diff --git a/public/index.html b/public/index.html index 8818a10..66473d7 100644 --- a/public/index.html +++ b/public/index.html @@ -4,7 +4,7 @@