-
Notifications
You must be signed in to change notification settings - Fork 1
Add a lock feature #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
mcintyre94
commented
Jan 22, 2026
- Uses webauthn biometrics, eg touch ID
- Optional, enable in settings
- If enabled, locks after 30 mins and on browser startup
Detailed plan for adding Touch ID / Windows Hello authentication to protect the extension UI. Includes: - WebAuthn integration via @lo-fi/webauthn-local-client - Lock screen UI component - Settings route for enabling/disabling - 30-minute inactivity timer - Browser restart detection Relates to #1
- Add @lo-fi/webauthn-local-client dependency for client-side WebAuthn - Create biometricLock/schemas.ts with Zod schemas for settings and state - Create biometricLock/storage.ts for persisting lock settings and state - Create biometricLock/webauthn.ts wrapper for biometric registration/auth - Add TypeScript declarations for webauthn-local-client
Simple branded lock screen with: - Orbit logo - "Orbit is locked" message - Unlock button with fingerprint icon - Error message display
- Create Settings route with biometric lock enable/disable functionality - Add Settings menu item to Home page menu (with divider) - Register Settings route in main.tsx router config - Disabling lock requires biometric auth first
- Create LockGuard component that checks lock state on mount - Wrap Layout with LockGuard to protect all routes - Connect route (/accounts/connect) bypasses lock check - Update activity timestamp on navigation when unlocked
- Create activity tracker that monitors user interactions - Update last activity timestamp on click, keydown, scroll, focus - Add browser startup handler to lock when browser restarts - Add alarm that checks every 5 minutes for 30-minute inactivity - Initialize activity tracking in main.tsx
Add "alarms" to manifest permissions to enable the periodic inactivity check that locks the extension after 30 minutes.
Code reviewI found 4 issues during review: 1. Security Vulnerability: Connect Route Bypasses Lock 🔴File: The // Connect route bypasses lock
if (isConnectRoute) {
return <>{children}</>;
}Problem: The Connect route displays ALL wallet accounts with sensitive information (addresses, labels, notes, tags). Any website can trigger a connection request via the Wallet Standard protocol, causing the sidepanel to open at Attack vectors:
Why this matters: Users who enable biometric lock expect their wallet addresses to be protected. This bypass completely undermines that protection. Wallet addresses are sensitive financial information that allow tracking holdings and transaction history. Recommendation: Require authentication before showing the connect dialog. Show lock screen first, then display accounts after successful biometric verification. 2. Bug: Lock Timeout Ineffective for Open Sidepanel 🔴File: The useEffect(() => {
checkLockState();
}, []); // Empty dependency array = runs once on mountProblem: If a user leaves the sidepanel open, the 30-minute inactivity timeout becomes completely ineffective. The background script will set Why this matters: This defeats a core security goal of the lock feature. The timeout is meant to protect against unauthorized access when the user steps away from their computer. Recommendation: Add one of the following:
3. CLAUDE.md Violation: Import Order 🟡File: CLAUDE.md specifies import order as: external packages → internal modules → relative imports (see rule) Current order: import type { InjectedEvent } from "../injected/events"; // relative
import { SidePanelEvent } from "../sidepanel/events"; // relative
import { makeConnectionSubmitForwardedEvent } from "./events"; // relative
import { isBiometricLockEnabled, setLockState, getLockState } from "~/biometricLock/storage"; // internal moduleExpected order: import { isBiometricLockEnabled, setLockState, getLockState } from "~/biometricLock/storage"; // internal module
import type { InjectedEvent } from "../injected/events"; // relative
import { SidePanelEvent } from "../sidepanel/events"; // relative
import { makeConnectionSubmitForwardedEvent } from "./events"; // relative4. CLAUDE.md Violation: Undocumented Directory Structure 🟡Files: All files in The new Recommendation: Update CLAUDE.md to include: Summary
The two security issues should be addressed before merging, as they significantly undermine the lock feature's security goals. |