Skip to content

Browser on Linux is turned on with elastos setup --browser, not by install.sh - #551

Merged
andersalm merged 14 commits into
developfrom
fix/201-browser-optin
Nov 6, 2026
Merged

andersalm merged 14 commits into
developfrom
fix/201-browser-optin

Conversation

@andersalm

Copy link
Copy Markdown
Contributor

Deepen notes

  1. Expert view: install.sh should never ask for sudo or download 900 MB for a feature the person has not chosen; turning Browser on must reuse the same signed helper admission and image verification, and a Home that turned it on must keep getting helper updates.
  2. Raw material: Anders's decision (5 Nov): Browser comes from Marketplace, not install.sh, once it works well (Marketplace: Get for apps, not only models #333 for the Marketplace Get); scripts/install.sh prepare_browser_linux_host, setup/browser_config.rs, gateway_browser_engine.rs.
  3. Methods: an explicit elastos setup --browser; gates keyed on "Browser was enabled on this Home", not host readiness; fake Linux hosts in the installer tests.
  4. Independent check: Claude review FAIL on the first version (an enabled Home stopped refreshing helpers; Browser hidden instead of explaining), fixed, Claude PASS. Codex Root CHANGES REQUIRED on f1232e1 (P1 Installer: verify the Browser helper hash before sudo install #406: the root helper copy was not bound to the admitted bytes; P2: Open did not repair helpers before the host probe), fixed in e7d1ded and 8f40786 with a race fixture and Open-consumer tests; Claude security review PASS; Root bounded SOURCE PASS on bc39a93 (Release 2.0.1 #535 comment 6683449321). Full Linux check PASS on bc39a93.

Change

  • On Linux, the installer no longer runs the Browser administrator setup or the Browser image download. On a fresh install of a Linux ARM64 computer that can run Browser, it names the command once.
  • elastos setup --browser turns Browser on: it asks before the one-time administrator changes, checks host access, then downloads and verifies the image with progress. Then restart Home once (the Browser bridges read their configuration at Home start).
  • Browser is listed on a Linux ARM64 Home before it is turned on; opening it shows the command instead of an error. Linux ARM64 without KVM says Browser needs KVM.
  • A Home that turned Browser on refreshes changed signed helpers on elastos setup and when Browser opens. A Home that never did downloads nothing and makes no sudo call.
  • The one-time administrator step runs only a root-owned copy whose SHA-256 equals the signed manifest's digest; the helper bytes are read once before the password prompt and handed to a fixed root step, so replacing the user's file meanwhile changes nothing that runs as root (Installer: verify the Browser helper hash before sudo install #406). Removal runs only the root copy.
  • Apple Silicon Macs are unchanged.

Part of #90. Release issue #535.

Add elastos setup --browser for signed host helpers, confirmed administrator setup and verified image preparation. Default Linux install/setup leave Browser preparation to that choice; Marketplace and Browser explain the command. Preserve Apple Silicon setup and move retired pool cleanup to explicit opt-in.

Deepen notes: gate every preparation entry path; start at 577bb01 install.sh:1117, setup/browser_config.rs:359 and api/gateway_browser_engine.rs:32; use fake Linux/process fixtures and existing signed admission; pinned installer/UI regressions fail before and current installer/behavior checks pass. Opus development/adversarial PASS covers tree d02f1da.

Checks: installer 97 (4 optional publisher-fixture skips), product-data tests 105, behavior 2181, source gate, both fmt checks and server all-target Clippy PASS. Focused Browser Rust tests pending a serial retry after the disk guard stopped parallel compilation before tests ran. No push.
Register Browser in the fixture's active component manifest and resolve the macOS temporary base before testing strict no-link pool removal. The first Browser library run passed 414 tests, failed these two new fixtures and ignored two; the current all-target gate will verify both repairs. Runtime behavior is unchanged.
Use the Home owner's stored Browser selection to refresh changed Linux helpers on setup and open. Offer Browser on supported Linux Homes with setup and restart guidance. Keep the installer hint for fresh Homes with accessible or ACL-repairable KVM, and verify the exact managed network script through its manifest checksum.

Verification:
- cargo fmt --all -- --check; chain-provider fmt check
- cargo clippy -p elastos-server --all-targets -- -D warnings
- cargo test -p elastos-server --all-targets browser (438 passed, 2 ignored)
- Home summary and installed verifier tests (5 passed)
- Browser Node tests (85 passed)
- scripts/test-source-gate.sh; scripts/test-behaviour.sh (2181 passed)
- python3 scripts/install-bootstrap-test.py (95 passed, 4 skipped)
- git diff --check
Keep Browser opt-in changes with the reviewed installer permission and process-age repairs. The combined tree retains all 17 incoming installer tests and all candidate test cases.

Verified combined tree 723a810: workspace and chain-provider formatting, server all-targets Clippy with -D warnings, 443 focused Rust tests, 85 Browser Node tests, source gate, 2181 behaviour tests, and installer suite (112 passed, 4 publisher-fixture skips).
Keep the signed release digest with the captured helper bytes. Install and reverify an owned copy in one sudo step, then execute the verified snapshot with the helper confirmation on the tty.

Verified: 6 Linux setup unit tests, 7 root bootstrap tests, all-target Clippy, formatting and the source gate. The full server rerun uses the CI process-provider fixtures.
Normalize the adapter choice before preparation. An existing local Engine selection admits helper repair before the host probe; a fresh Home keeps the setup refusal before downloads.

Verified: 4 actual Open consumer regressions, all-target Clippy, formatting, 1286 Browser Node tests and the source gate.
@andersalm andersalm added this to the 2.0.1 milestone Nov 6, 2026
@andersalm andersalm mentioned this pull request Nov 6, 2026
5 of 6 tasks
@andersalm
andersalm requested a review from irzhywau November 6, 2026 12:51
@andersalm

Copy link
Copy Markdown
Contributor Author

@irzhywau your security review is wanted here: this changes how the one-time administrator step for Browser on Linux runs (#406). The helper bytes are admitted against the signed manifest, read once before the password prompt, and handed on stdin to a fixed root step compiled into the Runtime, which writes a root-owned copy, checks its SHA-256 and runs only those bytes. Codex Root's bounded source pass (#535 comment 6683449321) and a Claude security review passed it. As with #536, it can merge into develop for the 2.0.1 build, and your review is a gate before 2.0.1 is signed (#535).

@irzhywau

irzhywau commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Independent adversarial security review — PR #551 (Browser on Linux via elastos setup --browser)

Two-model review (DeepSeek + Claude Opus 5.5), each finding re-checked against head acd2baeb3.

Verdict: PASS (bounded). Both handoff invariants hold; no blocking issue is introduced by this PR.

Confirmed controls

  • Only digest-admitted bytes execute as root. The SHA-256 the root step compares is taken from the admitted signed release (read_signed_release → admit_release, signature verified against the trusted source's publisher DIDs). This path has no unsigned/local-digest fallback — the "no signed release" case refuses before the prompt.
  • TOCTOU closed. Helper bytes are read once into memory before the sudo prompt, passed on stdin to a fixed bootstrap compiled into the Runtime, and executed only after an independent re-hash of the root-owned inode. The user path is never reopened at execute time; replacing the user's file after capture changes nothing.
  • No shell/argv injection. Absolute /usr/bin/sudo, /usr/bin/python3, /usr/bin/id; argv arrays with no shell; isolated -I interpreter mode. Install target is a compiled-in constant, not derived from the --data-dir argument; the directory walk is descriptor-relative, no-follow, ownership/writability-checked, with atomic temp+rename.

Follow-ups (non-blocking)

  • verify_checksum returns success when a component declares no required checksum; this path is safe because the caller separately requires a sha256: and the root step re-hashes, but the silent skip is a latent foot-gun to tighten.
  • The root-owned directory check reads mode bits, not POSIX ACLs; a pre-existing root dir with an ACL granting write would pass. Evaluate ACLs or refuse them.
  • The admitted helper, once its digest matches, runs as root with full builtins and receives the operator-controlled --data-dir. Admission proves provenance, not safety against hostile input — the helper's own symlink-safe, descriptor-relative use of --data-dir is part of the trust boundary and needs its own review.

Noted separately

One pre-existing, product-wide trust-anchor confirmation (provenance of the trusted-source publisher DIDs) is tracked outside this PR; it predates #551 and does not affect this verdict.

Gates unchanged

Installed Linux ARM64 human acceptance (real KVM host, one-time sudo, restart, Browser open) remains covered by #535/#406.

@andersalm
andersalm merged commit c38f870 into develop Nov 6, 2026
16 checks passed
@andersalm

Copy link
Copy Markdown
Contributor Author

Merged for 2.0.1 at acd2bae. Reviews: Claude FAIL on 8e1a360, fixed, Claude PASS on 63154b3; Codex Root CHANGES REQUIRED on f1232e1 (P1 #406 root helper not bound to admitted bytes; P2 Open repair order), fixed in e7d1ded and 8f40786, Claude security review PASS, tests strengthened in b6093f8, Root bounded SOURCE PASS on bc39a93; acd2bae only adds a develop merge (Root: all 21 reviewed files byte-identical). Full Linux check PASS on acd2bae; CI 15/15. Irzhy's security review stays a gate before 2.0.1 is signed (#535).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants