Files
archy/docs/security/2026-11-13-hardening-review.md

10 KiB

Independent release review of second hardening proposal

Review target: proposal 9ed09d8c471845cfb6d90830b6b0043abaadb85d against accepted release b53602afd. The original proposal was inspected without executing its code/tests or changing live nodes. Corrected publisher tooling was subsequently tested in disposable repositories as recorded below. The proposal has multiple merge bases with release. The security changes are commits 7d63fd1f3, 1634e8506, fb8a9418b, b2ffad60c, aad2d7731, a6491adc7, 9b16d62c6 plus correction 81f6a85e6; its Bump28 merge and unrelated UI commits are not security patches to replay.

Findings, highest impact first

  1. Integration conflicts require release-aware resolution; an older tree must not replace current files. A two-dot comparison finds older signer/intro/Pine/provider/APK files in the proposal, but that does NOT establish a normal three-way merge would remove newer work. An actual git merge-tree --write-tree b53602afd 9ed09d8c simulation retained most current fixes and reported three conflicts: core/archipelago/src/appgate/signer_provider.rs, launcher tests and app-session configuration tests. The simulation did not change the working tree or a branch. Preserve the current native provider, copied-provider identity paths, IndeeHub intro deferral, Pine HTTPS redirect port, browser viewport/scroll fixes and packaged Bump28. Resolve and test exact changed boundaries; do not copy the proposal tree wholesale.

  2. Payment message authority is incomplete. b2ffad60c adds source-window and exact-origin admission in neode-ui/src/components/AppLauncherOverlay.vue:564-566, and removes wildcard payment replies at lines 607-617. That protects immediate messages from unrelated windows. But pending payment at lines 592-603 records only request data and origin; the watcher at lines 725-755 clears it on close, not when store.url changes while the overlay stays open. approvePayment lines 620-669 can therefore spend after an iframe/app navigation, while sendPaymentResponse targets the current iframe or silently returns when its origin changed. This flaw predates the proposal but remains in its advertised boundary. Bind pending request to immutable app ID, frame/window, origin and generation; invalidate on navigation/replacement; verify no send on stale consent and exact terminal response on the original frame. Do this as a separate, reviewed payment change, not an unqualified one-line cherry-pick.

  3. Exact-origin identity cancel needs release-aware integration. b2ffad60c and 81f6a85e6 change useAppIdentity.ts:101-109 from wildcard to the iframe's target origin, which is a good narrow direction. Transplant only that cancel helper into release useAppIdentity.ts, retaining the current intro timing and copied-provider branches above. Test current same-origin app, cross-port/redirected app, iframe replacement, cancel and reselect on desktop, Companion native WebView and browser tab. launcherTargetOrigin(store.url) likewise needs a launch-redirect test before it is assumed to match the iframe's final origin.

  4. Private response cache patch is a plausible independent low-risk slice, with account-switch testing required. Release neode-ui/vite.config.ts:116-124 still has blanket /rpc/v1/ NetworkFirst Cache Storage, and release logout does not purge that named private cache. 7d63fd1f3 removes that route, adds Cache-Control: private, no-store to JSON RPC/proxy responses (core/archipelago/src/api/rpc/response.rs:57-61, handler/proxy.rs:115-129) and deletes only named private caches on logout (neode-ui/src/utils/privateCaches.ts:6-16; stores/auth.ts:164-168). Its correction 81f6a85e6 fixes the typed cache-name check. Integrate against current Vite config and auth store without touching public assets. Required installed checks: logout/login as another account, PWA upgrade with a pre-existing api-cache, no private response served offline, and login/public asset paint while offline then online. Preserve current Recent files logout clearing.

  5. Android and server transport hardening needs a real compatibility matrix. 81f6a85e6 Android/.../network/NodeOrigin.kt:5-13 replaces hostname-prefix matching with parsed scheme/host/effective-port for dashboard autofill and kiosk navigation. This closes deceptive-prefix admission, but verify LAN/mesh, HTTP→HTTPS redirect, IPv4/IPv6, app-port routing and current Companion WebView first paint on physical devices before accepting zero UX regressions. a6491adc7 server remote_input_origin.rs:4-14 denies a browser Origin without X-Archipelago-Remote-Input: 1, while native InputWebSocket.kt:126-138 adds that header. The header is a browser handshake guard, not authenticated device identity; no-Origin non-browser clients still pass. Check both old/new Companion pairing and remote control; do not call this full authorization.

  6. Signer relay verification is directionally useful but not phone-accepted. 1634e8506 BunkerManager.kt:100-120,321-338 verifies event ID/signature, kind, recipient and a ten-minute past/two-minute future window before decrypting/prompting. It inserts verified event IDs in the replay set before checking the pinned client pubkey, so unrelated valid addressed events can consume/evict replay slots; move the cheap client-author check before replay insertion. Verify delayed relay/reconnect requests around the time window, malformed and wrong-author events, cancel/approve exactly once, and JNI symbol on actual Bump28/Companion device. The proposal's source/JVM/ARM build evidence is not physical approval UX.

  7. Other small slices. fb8a9418b makes a missing/unreadable authenticated account fail closed in api/rpc/mod.rs:740-784; retain onboarding/remembered-session exemptions and test corrupted account, admin recovery, Cloud and paid-right read without extra sends. aad2d7731 plus 81f6a85e6 add development filesystem realpath/sensitive-target denial; apply only to dev middleware and test symlink, allowed source reads and absent auth. The publisher refusal in 9b16d62c6 should be adapted to the current Bump28 metadata/signing path rather than replacing it; an APK and metadata written with two separate renames are not one atomic pair. No public publish was reviewed here.

Release decision

Do not merge 9ed09d8c4 wholesale or deploy it now. The cache/header, dev filesystem and account-denial pieces are candidates for small release-based cherry-picks after focused tests; exact-origin cancel and Companion origin matching need release-aware implementation and installed/native checks. Payment generation binding, signer relay acceptance and device authorization are separate follow-ups. Run current-head required CI and maintainer desktop/mobile browser and physical Companion UAT on any selected UI/native changes. The proposal claims focused local passes, but the CI comments report both frontend and backend failure at exact current head 9ed09d8c as well as its earlier head. Failure details still need independent reconciliation; none of these results establishes current release acceptance.

Publisher findings and bounded change included

  • Proposal scripts/publish-companion-apk.sh:94-107 derives metadata from the base Gradle version, losing -debug and the Bump build override. Source inspection confirms 0.5.40 versus ordinary built 0.5.40-debug; the qualified Bump28 manifest is 0.5.40-bump28-debug. This is an existing defect left uncorrected by the proposed publisher patch. The release payload verifier rejects such mismatched metadata.
  • Proposal scripts/tests/test_companion_apk_publish_refusal.py:19 executes git add . with cwd=ROOT, staging the real checkout. It must never run unchanged against a working repository.
  • Adapted tooling in release commit 5af14de52 refuses missing prerequisites, extracts version/package identity from the signed APK using aapt, validates metadata before replacing served files, and keeps test staging wholly within disposable repositories. Four corrected tests PASS, including successful Bump suffix preservation and failed-publish preservation of both old files. The actual signed Bump28 APK independently produces the exact checked-in metadata. The root Git index stayed unchanged during tests. No runtime code, APK bytes, UI or node was changed by this tooling commit. Two file renames are not claimed to be a transactional pair.

All audit findings retained

Finding Release disposition
1: wallet administrator credential scoping Open; preserve external-wallet UX pending compatible design.
2: TLS/node transport identity Open; needs self-hosted certificate, rotation and recovery design.
3: WebView capability boundary Exact-origin candidate reviewed; broader capability policy open.
4: mobile secret storage and backup Open; no silent data/key migration.
5: APK authenticity/publisher Publisher tooling corrected here; private-key/distribution migration remains open. Existing beta signing identity retained.
6: remote-control admission Header guard is partial, not device authorization; compatibility qualification required.
7: legacy app messages Immediate sender checks are partial; pending-payment generation issue remains.
8: sensitive caching Candidate for separate qualification, including PWA upgrade and account switching.
9: missing account authorization Candidate requiring valid-session, recovery and new-installer acceptance.
10: development filesystem boundary Development-only candidate; not a production sandbox or a concurrent-writer guarantee.
11: advisory/CI policy Current-head CI failures unresolved; no security clearance inferred.
12: Flare authentication Open; no speculative feature deletion.
13: native relay signer verification Replay-admission correction plus new APK/JNI/physical acceptance required.

Do not include speculative refactors or dead-code removal in this beta merely because they appear in an audit recommendation. Preserve feature/UX contracts and qualify each change at its actual runtime boundary. This review is not a production security audit or clearance.