Skip to content

Security hardening, TS fixes, JS drag, and dynamic window resize#12

Open
edmundamoye wants to merge 2 commits intolcoutodemos:mainfrom
edmundamoye:security-and-ux-improvements
Open

Security hardening, TS fixes, JS drag, and dynamic window resize#12
edmundamoye wants to merge 2 commits intolcoutodemos:mainfrom
edmundamoye:security-and-ux-improvements

Conversation

@edmundamoye
Copy link
Copy Markdown

Summary

  • New security.ts module — centralized input sanitization, path traversal protection, binary verification, AppleScript escaping, and URL validation
  • Shell injection protection — validates session IDs, project paths, and plugin names before use in shell commands or file system operations
  • Whisper binary verification — checks binary is in a trusted directory (including Homebrew Cellar) and not world-writable before executing
  • Marketplace hardening — validates plugin names and repo formats to prevent path traversal via install/uninstall
  • JS-based window drag — replaces broken CSS -webkit-app-region: drag (incompatible with setIgnoreMouseEvents) with mousedown/mousemove IPC-based window repositioning
  • Dynamic window sizing — ResizeObserver + MutationObserver measures all rendered content (including portaled popovers) and resizes the Electron window to fit, capped at screen height
  • Fix all pre-existing TypeScript errors — Zustand selector types, Electron dialog option types, useRef initial values, pty-run-manager type narrowing, notification.mp3 module resolution

Test plan

  • Verify drag handle moves window freely across entire screen
  • Verify Option+Space toggle preserves last drag position
  • Verify window dynamically resizes when conversation expands/collapses
  • Verify popovers (settings, model picker) are not clipped by window boundary
  • Verify npm run dist builds without TypeScript errors
  • Verify marketplace install/uninstall still works
  • Verify voice transcription works with Homebrew-installed whisper-cli
  • Verify Open in Terminal still launches correctly

Edmund Amoye and others added 2 commits March 18, 2026 04:49
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
lcoutodemos added a commit that referenced this pull request Mar 20, 2026
…play

Security (from PR #12 analysis):
- OPEN_IN_TERMINAL: UUID-validate sessionId, reject malicious projectPath,
  use single-quoted shell escaping to block $() and backtick injection
- LOAD_SESSION: UUID-gate sessionId to prevent path traversal
- LIST_SESSIONS/LOAD_SESSION: reject null bytes, newlines, non-absolute projectPath
- OPEN_EXTERNAL: replace regex with URL constructor for protocol/hostname validation
- Marketplace install/uninstall: validate pluginName charset, repo format,
  sourcePath traversal, and enforce resolved path stays under ~/.claude/skills/

Performance:
- Replace execSync with async execFile in transcription to stop blocking
  the Electron main thread (eliminates macOS loading cursor during voice input)
- Add per-phase timing logs for transcription diagnostics
- Conditional fallback re-run: only re-transcribe if first run produced no stdout

UI:
- Normalize model IDs with context window hints (e.g. "[1m]") for display
- Add getModelDisplayLabel helper for future-proof model name rendering
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant