This document tracks security requirements for features that execute helpers, read untrusted files, extract archives, fetch URLs, or modify user data.
Initial rules:
- Archive extraction must reject path traversal and symlink escapes.
docs/archive-support.mddefines the read-only helper strategy and extraction security tests required before archive compare is enabled. - Helper processes must have timeouts, cancellation, size limits, stderr capture, and cleanup. The core plugin runner enforces these limits for inline and temp-file-backed unpacker and prediffer text operation MVPs, and rejects plugin output paths outside the assigned temp directory.
- Webpage/URL compare must be opt-in and document network/cache/cookie behavior.
The detailed privacy boundary is in
docs/webpage-compare.md. The bundledpackaging/plugins/web-fetch/web-fetchhelper enforces an SSRF policy: onlyhttp/httpsschemes are honoured, the host must resolve to a publicly-routable address (no private, loopback, link-local, multicast, reserved, or unspecified ranges), and HTTP redirects are revalidated against the same policy. The env varLINSYNC_WEB_FETCH_ALLOW_LOOPBACK=1exists only to letcrates/linsync-core/src/webpage.rsintegration tests reach their localhttptestfixture servers; it relaxes loopback (127.0.0.0/8 and ::1) while keeping every other restriction in place. Do not set this in any production install or release-build environment. - Document/OCR helpers are local by default and document their temporary-file
cleanup, privacy behavior, and helper limits. The implemented design is in
docs/document-compare-implementation.md. - Folder sync and merge operations must stage a plan before destructive writes.
- Delete operations must prefer FreeDesktop Trash and clearly confirm permanent deletion when Trash is unavailable.
- The GUI's local HTTP/JSON bridge (
apps/linsync-gui/src/main.rs) binds only to127.0.0.1, refuses requests whoseOrigin:header is not loopback, emits noAccess-Control-Allow-Originheader, caps request size at 32 KiB and header count at 64, and applies a 5-second read/write timeout per connection. Mutating endpoints (/copy,/copy-all,/save,/undo,/redo,/tab/activate,/tab/close) must continue to reject row indices that would force unbounded pane growth. The launch-context JSON written under$XDG_CACHE_HOME/linsync/gui/launch-<pid>.jsonis created mode0o600to keep recent-paths and session metadata out of other local users' view. These gates are covered by the bridge tests inapps/linsync-gui/src/main.rs(bridge_responses_do_not_advertise_wildcard_cors,bridge_rejects_cross_origin_requests,bridge_accepts_loopback_origin,copy_row_rejects_out_of_range_index).