[browser] Autofill for Edge and Chrome: custos-browser, custos-native, the extension, docs/BROWSER.md (v0.15.0) #18

Manually merged
mnovak merged 2 commits from feature/browser-ext-v2 into main 2026-11-10 21:50:09 +01:00
Owner

The browser extension for Edge and Chrome (Custos v2, logins first; passkeys later), brought up to date with main and documented. Proposed as v0.15.0 (the next free version; v0.14.1 is main). Not tagged: waiting for Mark's OK.

What

  • crates/custos-browser: which login may be filled into which page (Origin::parse, login_matches, best_match): the login's host or a subdomain of it, same scheme and port, https only (plain http only for localhost); userinfo URLs refused; no fuzzy matching, so look-alikes never match. Native messaging frames (4-byte LE length + JSON, 64 KiB to the host, zeroized).
  • crates/custos-native: the native messaging host. Forwards only browser_status, browser_match, browser_fill, rebuilt from their known fields, to \\.\pipe\custos-domi, and only to a pipe served by custos.exe.
  • extension/: the MV3 extension (fixed id jchkapmceepdnlhagfppeckggaecdcmn from the key in its manifest; version 0.15.0). A button on login fields, a list of the site's logins on click, fill on pick; the toolbar popup. The origin is always the browser's (sender.url).
  • docs/BROWSER.md: the pieces, the matching rule, the messages and errors, registration, the threat model, what is not there yet. README and CLAUDE.md list the crates.

Commits

  • The code from feature/browser-extension (e2daf81, 2026-11-04), cherry-picked onto main without conflicts.
  • Docs and the version.

Checked

  • cargo test --workspace --release: 225 passed, 0 failed (custos-browser 6 + 1 doc test, custos-native 2).
  • Edge end to end with the desktop branch (Custos feature/browser-ext-v2, pinned to this branch's revision): a test Custos (own identifier, data folder, pipe), the extension loaded unpacked, a local login page: fixed id, Custos asks once, username + password + 2FA code filled, another origin (127.0.0.1 vs localhost) gets nothing and no second question, a page script cannot message the extension, the temporary HKCU registration removed afterwards: 10/10.

Self-review

  • No new crypto; the only new dependencies are windows-sys (pipe, process image name) and the workspace's serde_json/zeroize.
  • No secret in logs or errors: the host's errors are fixed codes; the frames and the parsed answer are wiped.
  • The rule lives here, the desktop applies the same crate on every fill, so a compromised extension cannot widen it.
  • Not done: passkeys, Firefox, saving logins from the browser, a store listing. The private key for packing a .crx with this id exists outside the repo (it is only needed to pack, not to load unpacked).

After merge: tag v0.15.0, then the desktop PR switches its rev pin to the tag.

The browser extension for Edge and Chrome (Custos v2, logins first; passkeys later), brought up to date with main and documented. Proposed as **v0.15.0** (the next free version; v0.14.1 is main). Not tagged: waiting for Mark's OK. ## What - `crates/custos-browser`: which login may be filled into which page (`Origin::parse`, `login_matches`, `best_match`): the login's host or a subdomain of it, same scheme and port, https only (plain http only for localhost); userinfo URLs refused; no fuzzy matching, so look-alikes never match. Native messaging frames (4-byte LE length + JSON, 64 KiB to the host, zeroized). - `crates/custos-native`: the native messaging host. Forwards only `browser_status`, `browser_match`, `browser_fill`, rebuilt from their known fields, to `\\.\pipe\custos-domi`, and only to a pipe served by `custos.exe`. - `extension/`: the MV3 extension (fixed id `jchkapmceepdnlhagfppeckggaecdcmn` from the `key` in its manifest; version 0.15.0). A button on login fields, a list of the site's logins on click, fill on pick; the toolbar popup. The origin is always the browser's (`sender.url`). - `docs/BROWSER.md`: the pieces, the matching rule, the messages and errors, registration, the threat model, what is not there yet. README and CLAUDE.md list the crates. ## Commits - The code from `feature/browser-extension` (e2daf81, 2026-11-04), cherry-picked onto main without conflicts. - Docs and the version. ## Checked - `cargo test --workspace --release`: 225 passed, 0 failed (custos-browser 6 + 1 doc test, custos-native 2). - Edge end to end with the desktop branch (Custos `feature/browser-ext-v2`, pinned to this branch's revision): a test Custos (own identifier, data folder, pipe), the extension loaded unpacked, a local login page: fixed id, Custos asks once, username + password + 2FA code filled, another origin (127.0.0.1 vs localhost) gets nothing and no second question, a page script cannot message the extension, the temporary HKCU registration removed afterwards: 10/10. ## Self-review - No new crypto; the only new dependencies are `windows-sys` (pipe, process image name) and the workspace's `serde_json`/`zeroize`. - No secret in logs or errors: the host's errors are fixed codes; the frames and the parsed answer are wiped. - The rule lives here, the desktop applies the same crate on every fill, so a compromised extension cannot widen it. - Not done: passkeys, Firefox, saving logins from the browser, a store listing. The private key for packing a .crx with this id exists outside the repo (it is only needed to pack, not to load unpacked). After merge: tag `v0.15.0`, then the desktop PR switches its `rev` pin to the tag.
mnovak added 2 commits 2026-11-10 13:17:01 +01:00
mnovak manually merged commit 1292c09d02 into main 2026-11-10 21:50:09 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mnovak/CustosPublic#18