Pre-1.0 security review: remediate all findings #8

Merged
raucao merged 24 commits from chore/security_review into main 2026-11-30 08:21:35 +00:00
24 Commits
Author SHA1 Message Date
raucao 55e1155e8e ci: document the runner setup (I3)
CI / test (push) Successful in 1m43s
CI / test (pull_request) Successful in 49s
The cache only works when the job container shares the host network (a
bridge job cannot reach the runner's cache server through a host
firewall); record that, force_pull and node_download so the runner can be
rebuilt without rediscovering them.
2026-11-30 11:34:19 +04:00
raucao 1ee4930f2b ci: run the job on a custom Arch image (I3)
CI / test (push) Successful in 3m40s
CI / test (pull_request) Successful in 49s
The ubuntu-latest runner image ships GTK 4.22, which cannot satisfy the
crate's v4_24/v1_10 features (they want GTK >= 4.23 / libadwaita >= 1.10,
newer than the latest stable GNOME release), so the first CI run failed
compiling gdk4-sys. The GNOME OS SDK is no better.

Build a regent-ci image (build-aux/ci/) from Arch with the GTK/libadwaita
headers, a rustup-pinned toolchain and the static cargo-deny binary baked
in, register a repo-level runner with the matching label, and drop the
apt/rustup/install-action steps.

Bump url to 2.5.9 (RUSTSEC-2026-0592), which the cargo-deny step would
otherwise fail on.
2026-11-30 11:18:36 +04:00
raucao b42f9b925a chore: fix the clippy gate, guard the vault version, add CI (I3)
CI / test (pull_request) Failing after 2m31s
CI / test (push) Failing after 2m41s
2026-11-30 10:31:00 +04:00
raucao 4076f6707b approval: disclose NIP-04 requests with a legacy banner (I2) 2026-11-30 10:31:00 +04:00
raucao 5e071a8d9e main: read the pairing URI from stdin with --pair - (I1) 2026-11-30 10:31:00 +04:00
raucao b5a88b6c4c icons: bound inline data URLs before decoding (L7) 2026-11-30 10:31:00 +04:00
raucao fc4eab35c9 store: create private (0700) directories (L6) 2026-11-30 10:31:00 +04:00
raucao f4487f4425 headless: refuse shared passphrase files; wipe secret buffers (L5) 2026-11-30 10:31:00 +04:00
raucao e67963d86b signer: serialize the pairing dialog through the approval queue (L4) 2026-11-30 10:31:00 +04:00
raucao 6e1f35ef62 store: pin the unlocked-vault gate for change/export (L3) 2026-11-30 10:31:00 +04:00
raucao 9c886b7493 ui: confirm export passwords, mask imports, expire copied secrets (L2) 2026-11-30 10:31:00 +04:00
raucao 910554c8d6 signer: rotate the pairing secret on every new pairing (L1) 2026-11-30 10:31:00 +04:00
raucao b4fe138641 store: serialize vault mutations and write unique temp files (M9) 2026-11-30 10:31:00 +04:00
raucao 0f983ff558 signer: drop strangers silently and dispatch with bounded concurrency (M8) 2026-11-30 10:31:00 +04:00
raucao 75f4998ced sanitize: strip control and bidi characters from client text (M7) 2026-11-30 10:31:00 +04:00
raucao 5d750fb0d3 policy: share the auto-approval limit with the running signer (M6) 2026-11-30 10:31:00 +04:00
raucao 5a9fc6ee18 state: lock the vault on suspend and count sleep in the auto-lock (M5) 2026-11-30 10:31:00 +04:00
raucao 35c52c12cf signer: validate client relays and scope responses to the arrival relay (M3) 2026-11-30 10:31:00 +04:00
raucao dd089e1855 app: take an unconditional single-instance lock (M4)
Both the GUI (in startup) and headless take an unconditional flock on regent.lock (0600); a refused instance short-circuits activate/open so it cannot pair.
2026-11-30 10:31:00 +04:00
raucao 8df0357d13 icons: harden the HTTPS fetch against SSRF (M2)
The single HTTPS fetch now sets no_proxy, rejects URL userinfo on every hop, and allow-lists IPv6 to 2000::/3 minus the special ranges; IPv4 rejects all of 0.0.0.0/8.
2026-11-30 10:31:00 +04:00
raucao c435fccd8f signer: store a permission only once the request is answered (M1)
gate() no longer writes apps.json; authorize_inner re-checks the app's identity (and its stored permission) after the last await and only then stores 'always', so a revoke or rebind during a prompt denies.
2026-11-30 10:31:00 +04:00
raucao 890f934e4a icons: gate image dimensions before decoding (H3)
decode() reads the container header and refuses anything over 1024x1024 before gdk::Texture::from_bytes allocates it; preview_icon no longer caches a pre-consent texture.
2026-11-30 10:31:00 +04:00
raucao 55f069e978 approval: disclose what sign_event/encrypt cannot show in full (H2)
The dialog now shows the client-requested created_at and warns (adw::Banner) when content, tags, tag values or an encrypt message exceed what it can show, and offers the full encrypt message. incoming() rejects a malformed kind/content/tags instead of coercing them.
2026-11-30 10:31:00 +04:00
raucao a5a1788319 signer: drop replayed and stale NIP-46 requests (H1)
kind:24133 is ephemeral, so every relay delivery of a captured request reached the responder again. A ReplayGuard in the responder loop now drops an event whose created_at is outside a 120 s window (or predates this run) and any event id already seen.
2026-11-30 10:31:00 +04:00