Repository navigation
fix(browser): partition site permissions by context and prevent Chromium persistence - #305
Merged
Merged
Conversation
… persistence, use DISMISS, sync revocations, and block agent clipboard write
|
PR test build retired — merged into |
Hona
added a commit
that referenced
this pull request
Nov 20, 2026
- Fold security-confirmed merged PRs #292 (6d7a6ed, WS-1 mandatory RemoteServer proxy), #294 (ae3e910, BROWSER-UI file-link/click-to-run fix with known symlink/junction root limitation), and #274 (5da6474, WS-9 engine MV3 extension host, inert without --extension flags) - Update browser Reviewed column: #301 in rework (#287 eager-attach time_updated regression still live on dev), #296/#298/#302/#303/#305/#306 in rework, #307 open for pre-merge security review - Audit upstream anomalyco/opencode fe8def6854..4122af0206 (+2 commits: 1 skipped #65255 core/codemode, 1 added UP-135 #65215 -> WS-8)
… add PermissionTracker lifecycle, lock isolated device guards, and make RemoteServer visit-only
…e temp file across pre-spawn Preferences scrub
…ew context switch
This was referenced Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Known Gap (Disclosed Ahead of Merge — Immediate Next HIGH-Urgency Follow-Up PR)
While
ALLOWis live inDefault'sHostContentSettingsMap, anagent_driven(or plugin-controlled) tab inDefaulton the exact same origin silently inheritsnotificationsandclipboard-read— andgeolocationon hosts where OS Location is enabled — for both(a)"Always allow"and(b)"Allow this time"while the granting human tab stays on that origin (camera/microphonestay refused per-tab viaon_request_media_access_permission). Fixing controlled-tab permission inheritance + per-tabclipboard-writerefusal via per-tabPermissions-Policy,Notificationstubbing, andcheck_cdpuserGesture: truestripping is the immediate next HIGH-urgency PR before any engine publish.Live CEF 156.0.26 Probe Matrix (
DefaultTab 2agent_driven: true, same originhttp://localhost:<p>as human Tab 1)notifications:(a)"Always allow"->permissions.query == "granted",new Notification(...)succeeded (ok:test-ORIG_A, 0 prompts).(b)"Allow this time"-> same silent grant while Tab 1 stayed on origin; reverted to"prompt"immediately on Tab 1 cross-origin navigation or close.clipboard-read:(a)"Always allow"->permissions.query == "granted",navigator.clipboard.readText()succeeded (ok:13, reading"human-copy-ok"off the OS clipboard, 0 prompts).(b)"Allow this time"-> same silent read (ok:13, 0 prompts) while Tab 1 stayed on origin; reverted to"prompt"immediately on Tab 1 cross-origin navigation.cameraµphone(getUserMedia):permissions.queryread"granted", however CEF 156 Alloy STILL consultedTabPermissionHandler::on_request_media_access_permission(is_media: true) every time (camPromptConsulted: true,micPromptConsulted: true), sogetUserMediawas NOT silently granted (err:NotAllowedError:Permission denied).geolocation: Chromium wrotegeolocation: { "http://localhost:<p>,*": { "setting": 1 } }toDefault'sHostContentSettingsMap. On Windows with OS Location off,GeolocationPermissionContextWinre-prompted (geoPromptConsulted: true); on macOS/Linux (and Windows with OS Location enabled), Chromium resolvesgeolocationdirectly fromHostContentSettingsMap == ALLOW.DefaultoriginB,PrivateoriginA, and proxiedRemoteServeroriginAall stayed"prompt"under both(a)and(b).Round-3 Fix (
d590a0b1, Addressing READER-9 Round-2 Blocker)Default/Preferenceslock & temp-file race (crates/browser-pane/src/{profile.rs, prompts/store.rs, transport.rs}):profile::try_lock_exclusive(dir) -> Option<File>matchingapps/browser-engine/src/profile.rs:98(create(true).truncate(false).write(true)+try_lock()).scrub_chromium_preferences_for_older_enginenow holds both an in-processPREFS_SCRUB_LOCK: Mutex<()>(serializing multi-window spawns in one process) and the exclusive OSengine.lockhandle across the entire read-modify-rename (dropping before.spawn()).Preferences.tmp-{pid}-{seq}(PREFS_SCRUB_SEQ: AtomicU64) and removestmpif eitherwriteorrenamefails.probe-prefs-race): 50 runs × 3 concurrentBrowserHostspawns per run (2 in-process threads + 1 external process = 150 spawns over seeded 48 KBDefault/Preferences) ->validJson: 50/50,revokedScrubbed: 50/50,keptIntact: 50/50,zeroLeftoverTmps: 50/50.prove-fix3-r2.ts:73(navigator.hid.requestDevice({ filters: [] })) and reran on CEF 156.0.26 ->hid: "empty:0"(zero picker, zero grant) acrossDefault,Private, and proxiedRemoteServer.Summary of Changes (Round-1 READER-9 Findings 1–4 +
origin/devb5167f7eMerge)AgentClipboardGuardremoved): RemovedAgentClipboardGuardcompletely fromprompts.rs,handlers.rs, andengine.rs(human clipboard write works while controlled tabs share the origin; per-tab clipboard-write refusal moves to the immediate follow-up PR).PermissionTrackerlifecycle inapps/browser-engine/src/permissions.rs):#[serde(default)] persist: booltoHostMsg::AnswerPermissionandHostMsg::SyncSitePermissions { entries }(SitePermissionEntry)."Always allow"/"Never allow"(Defaultonly,persist: true) keepHostContentSettingsMaplive until Settings revocation;"Block"(dismiss: true) usesCEF_PERMISSION_RESULT_DISMISS."Allow this time"(persist: false) is ref-counted per(ctx_scope, tab_id, origin, kind)and reset toDEFAULTon committed cross-origin navigation, tab close,ExtEffect::CloseTab,ReopenTabs, andShutdown/Drop(beforecef::shutdown()).scrub_legacy_content_settingswipes all 6 exact-origin permission tables inDefault/Preferences(plusset_website_setting(..., GEOLOCATION_WITH_OPTIONS, None)), andBrowserHostsyncsrune.sitePermissionsonReadyand everySettings > Browseredit.USB_GUARD,SERIAL_GUARD,HID_GUARD,BLUETOOTH_GUARD,BLUETOOTH_SCANNING,FILE_SYSTEM_READ_GUARD, andFILE_SYSTEM_WRITE_GUARDacrossDefault, isolated context prefs, and per explicit origin on every navigation (Default,Private, proxiedRemoteServer).RemoteServerVisitOnly+ older-engine Settings restart notice): SimplifiedPermissionScopeto{ Profile, VisitOnly }; exposedpermissionSynconBrowser:Engine(); addedsettings.sites.restartNote(plugins/browser/locales/en.json) + locked pre-spawnDefault/Preferencesscrub for older engines.origin/devb5167f7eincl.#294,#274,#307,#306) & verbatim move: MovedEngineManager::{waits_for_texture, poll_frames, run_frames, frames_failed}verbatim toapps/browser-engine/src/engine/frames.rs(engine.rs1,451/1,500 lines).(Zero tests added/edited; zero
.github/edits; zero new third-party crates.)Verification (
d590a0b1, All 5 Targets + Live Proofs)e32c10a8) CI:guardrailspass,planpass,build-macospass,build-windows (arm64)pass (build-windows (x64)pending, 0 failures).engine.rs1,451/1,500;client.rs1,472/1,500; 0 errors).apps/browser-engine --bins,cargo check --workspace,cargo check -p browser-pane --no-default-features— clean (0 warnings).scripts/web.ps1 -Check): clean (0 warnings).adais,x86_64-unknown-linux-gnu):--workspace --all-targetsclean (27 s;apps/browser-engineuntouched sincee32c10a8clean check).air,aarch64-apple-darwin, undermac-lock-as.py):--workspaceclean (4 s,air_free: 65.5 GiB).proof/ws1/fix3-permissions.md,OPENCODE_RUNE_OTEL=0, scratch profiles):prove-fix3-r2.ts(fixednavigator.hid.requestDevice->empty:0),probe-prefs-race(50/50 valid JSON across 150 concurrent multi-thread + multi-process spawns),prove-fix3-settings.ts,#292pair,#306probe — ALL PASS.Held non-draft awaiting READER-9 third read before merge (do not self-merge).