mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-12 00:44:27 -06:00
Audit finding 21 (CWE-306): run_command handed document callback authority to whatever accepted the TCP connection. Zotero's protocol is fixed and has no authentication, so WordCraft now establishes what it can about the peer itself: - the address must be loopback, refused before connecting (ZoteroError::Refused); - on Linux/Android, before the command is sent, the kernel socket table (/proc/net/tcp, tcp6) must show the listener's end of this connection owned by the same UID as ours; another user's listener, or one whose owner can't be established, is refused. No unsafe, no new dependencies. macOS, Windows and the BSDs have no such table without OS calls; there the loopback rule is the guard. The residual risk is documented in docs/zotero.md. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>