Repository navigation
fix: enforce File System Access .git write blocks and hypervisor UNC shares (46-x-y) - #55344
Conversation
…shares Electron's copy of ShouldBlockAccessToPath() never consulted suffix_block_path_rules_, so Chrome's kBlockWrite rules for */.git/hooks, */.git/config and */.git/modules were not enforced. Match Chrome 158's matcher: plumb the AccessTrigger into the blocklist check, apply kBlockWrite rules only for AccessTrigger::kSave and AccessTrigger::kProgrammaticWrite, and evaluate suffix rules with case-insensitive component matching. The copy of GenerateBlockPaths() exposed by refactor_expose_file_system_access_blocklist.patch had also drifted from 158.0.8118.0, so sync its block list with upstream: .git/hooks, .git/config and .git/modules on all platforms, ~/.config and shell startup files on all platforms, /dev on macOS, and ~/.local/share, ~/.fonts.conf(.d) and ~/.pki on Linux. Also port IsLocalUNCServer() so that hypervisor host-share UNC servers (\\Mac, \\psf, \\vmware-host, \\.host, \\vboxsvr, \\vboxsrv) and trailing-dot server names are treated as local UNC paths on Windows. This landed upstream in 158.0.8120.0, after this branch's Chromium. Upstream: - https://chromium-review.googlesource.com/c/chromium/src/+/8361594 - https://chromium-review.googlesource.com/c/chromium/src/+/8376681 - https://chromium-review.googlesource.com/c/chromium/src/+/8405125 - https://chromium-review.googlesource.com/c/chromium/src/+/8619619 - https://chromium-review.googlesource.com/c/chromium/src/+/8424981 (cherry picked from commit 1fefa1a) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01MtuMgvwAcw7t9Q6HEB31Vx
There was a problem hiding this comment.
I reviewed this PR and didn't find any bugs. I reviewed it from a standalone clone, without the Chromium tree. A human should still look at it, because it changes the File System Access blocklist and permission path matching, and syncing the blocklist means apps on 46-x-y can no longer open several home-directory paths.
What was reviewed:
- The new suffix-rule loop in
ShouldBlockAccessToPath: thestd::searchmatch, rebuilding the path from the root to the end of the match, and how that interacts withnearest_ancestorand thekBlockWritetrigger gate (it only fires forkSaveandkProgrammaticWrite). IsLocalUNCServer: it strips one trailing dot and compares case-insensitively, which covers the oldwsl.localhost.entry.AccessTriggeris threaded through both the immediate path and the deferred path (rules not yet initialized) ofCheckPathAgainstBlocklist. I also checked the new spec's read-allowed and write-blocked cases against the patch's new blocklist rules.
Extended reasoning...
The change touches the main-process File System Access permission context (shell/browser/file_system_access) and the Chromium patch that exposes the blocklist. It adds suffix-rule matching, a write-only gate for kBlockWrite rules, more local UNC server names, and many new blocked paths on every platform. This is a permission and sandbox-escape surface, and the expanded blocklist changes behavior that apps can see on a stable release line. I reviewed from a standalone clone, so I couldn't check the upstream Chrome matcher this code claims to follow. Those facts, not any defect found, are why I'm deferring instead of approving.
|
The latest run on 1ebbf13, Build 40368112560, is green after one re-run. Only one job was red, and this PR didn't cause it:
The Windows UNC spec passed on both arches. The "File System Access permission scope" suite (6 tests) passed everywhere it ran: linux-x64, linux-x64-asan, linux-x64-ubsan and linux-arm64 test 2, windows-x64 and windows-arm64 test 2, macos-arm64 darwin 2 and mas, and macos-x64 darwin 1 and mas. No known shared failure showed up in this run, and every other job passed on the first attempt. Generated by Claude Code |
…klist Shares a fixture directory over loopback SMB and pastes it under different UNC server and share names, checking that local server names (127.0.0.1, and a trailing-dot localhost when it resolves) and shares ending in '$', including drive admin shares, are blocked while other servers are not. The trailing-dot case pins down the intentional change from Electron's previous matcher. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01MtuMgvwAcw7t9Q6HEB31Vx
|
Release Notes Persisted
|
Bring the roll up to date with the latest 46-x-y. Conflict resolution: * DEPS: keep chromium_version 159.0.8130.0. * refactor_expose_file_system_access_blocklist.patch: take 46-x-y's version (with the #55344 blocklist sync) and re-apply the rules from #55417, #55436 and #55472 on top of it: /run, ~/.cache on all platforms, the Vim startup files, the .mvn kBlockWrite suffix rule, the updated base::DIR_CACHE comment and the 159.0.8129.0 description paragraph. * All other conflicting patch files only differed in index lines, hunk offsets and context from 46-x-y's 158.0.8127.0 refreshes; keep the roll's versions, which are refreshed for 159.0.8130.0. * patches/chromium/.patches: keep the patches 46-x-y added (fix_handle_a_null_pending_call_in_dbus_objectproxy.patch, feat_update_executioncontext_api.patch, use_forward_slashes_for_the_default_crdtp_include_dir_in_templates.patch). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KX1hkJp43WY91qLdNy5kyG
Requested by Samuel Attard
This is the 46-x-y counterpart of #55328. Electron's own copy of Chrome's File System Access path matcher never checked the suffix rules, so Chrome's
kBlockWriterules for.git/hooks,.git/configand.git/moduleswere not enforced, and it did not treat the hypervisor host-share UNC servers (mac,psf,vmware-host,.host,vboxsvr,vboxsrv) or trailing-dot server names as local. Because this branch does not have #54751, which main's fix builds on, this PR takes the #55329 approach: it keeps Electron's own matcher and adds the missing checks. Following CL 8361594, CL 8376681 and CL 8405125,kBlockWriterules now apply to save-picker and programmatic write operations and suffix components are compared case-insensitively. The UNC server handling follows CL 8424981, which landed upstream in 158.0.8120.0, just after this branch's 158.0.8118.0. On this branch the block list copied intorefactor_expose_file_system_access_blocklist.patchhad also drifted from 158.0.8118.0, so it is synced with upstream. That adds the.git/configand.git/modulesrules from CL 8619619, applies.git/hooksand~/.configon all platforms, and adds upstream's shell startup file, macOS/devand Linux~/.local/share,~/.fonts.conf(.d)and~/.pkirules. A new spec inspec/chromium.spec.tscovers the.gitwrite blocks and checks that reading them stays allowed. The only caveat is that the block list sync means apps on this branch can no longer open those home-directory paths, matching Chrome 158.🤖 Generated with Claude Code
https://claude.ai/code/session_01MtuMgvwAcw7t9Q6HEB31Vx
Generated by Claude Code
Notes: Fixed File System Access blocklist gaps for
.gitfiles, shell startup and config files, and UNC shares.