Skip to content

v0.3.1 — Security hardening and race condition fixes

Choose a tag to compare

@prismatic7 prismatic7 released this 11 Sep 11:42
· 88 commits to main since this release

Security Hardening & Race Condition Fixes

This release addresses high-priority security vulnerabilities (sandbox escape vectors, path traversal, dialog deadlocks) and multiple concurrency/race conditions across the Hermes agent interface.

Security Mitigations

  • Sandbox escape mitigations: Disarmed dangerous URI schemes (javascript:, file:, chrome:, data:) in MarkdownRenderer and prevented unhandled schemes in HermesChatView from invoking privileged Gecko chrome execution. Added nested parenthesis link URL support.
  • Workspace sandboxing & database protection: Sandboxed Hermes ACP agent session cwd and workdir to <profile>/zotero-hermes/workspace/ (isolated from zotero.sqlite), and disabled ACP filesystem client capabilities.
  • Path traversal prevention: Enforced strict ID validation (/^[a-zA-Z0-9_-]+$/) across all ConversationManager file access methods.
  • Modal dialog deadlock fix: Handled native cancel and close events in ApprovalDialog so pressing Escape resolves cleanly rather than deadlocking the approval queue.

Race Condition & Concurrency Fixes

  • Process spawn mutex: Added connectPromise mutex in HermesClient to prevent concurrent calls from spawning multiple hermes acp child processes.
  • Stream buffer bleed: Added abortActiveStream() and buffer clearing on chat switch, creation, or deletion; dropped reasoning chunks targeted at inactive conversations.
  • Debounced save race: Captured target conversation ID in ChatManager.scheduleSave() to prevent delayed debounced writes from clobbering switched chats.
  • Duplicate SSE stop events: Guarded against spurious duplicate stop notifications in HermesApiClient.
  • Context synchronization: Added removeAttachedItem() to ItemManager and synchronized with ContextBar.onRemoveItem.
  • Multi-window teardown: Switched to per-window WeakMap<Window, any> in hooks.ts to prevent window close from disrupting other open windows.

Install

Download hermes-agent-for-zotero.xpi and install via Zotero → Tools → Plugins → gear → Install Plugin From File.