Skip to content

fix: enforce File System Access .git write blocks and hypervisor UNC shares (46-x-y) - #55344

Merged
jkleinsc merged 2 commits into
46-x-yfrom
security-fix/46-x-y/fsa-upstream-matcher
Oct 26, 2026
Merged

jkleinsc merged 2 commits into
46-x-yfrom
security-fix/46-x-y/fsa-upstream-matcher

Conversation

@claude

@claude claude Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

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 kBlockWrite rules for .git/hooks, .git/config and .git/modules were 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, kBlockWrite rules 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 into refactor_expose_file_system_access_blocklist.patch had also drifted from 158.0.8118.0, so it is synced with upstream. That adds the .git/config and .git/modules rules from CL 8619619, applies .git/hooks and ~/.config on all platforms, and adds upstream's shell startup file, macOS /dev and Linux ~/.local/share, ~/.fonts.conf(.d) and ~/.pki rules. A new spec in spec/chromium.spec.ts covers the .git write 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 .git files, shell startup and config files, and UNC shares.

…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
@claude
claude Bot requested a review from a team as a code owner October 26, 2026 08:18
@claude claude Bot added 46-x-y backport-check-skip Skip trop's backport validity checking security 🔒 semver/patch backwards-compatible bug fixes labels Oct 26, 2026

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: the std::search match, rebuilding the path from the root to the end of the match, and how that interacts with nearest_ancestor and the kBlockWrite trigger gate (it only fires for kSave and kProgrammaticWrite).
  • IsLocalUNCServer: it strips one trailing dot and compares case-insensitively, which covers the old wsl.localhost. entry.
  • AccessTrigger is threaded through both the immediate path and the deferred path (rules not yet initialized) of CheckPathAgainstBlocklist. 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.

@claude

claude Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

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:

  • lint / Lint: failed at "Download GN Binary" before any linting ran. GitHub returned a 429 on all four tries while fetching the GN version from DEPS (curl: (22) The requested URL returned error: 429, then Process completed with exit code 22). Every lint and typecheck step was skipped. I re-ran the job once and every step passed, including Run Lint and the script and spec typecheckers.

The Windows UNC spec passed on both arches. chromium.spec.ts ran on windows-arm64 test 2 and windows-x64 test 2, and "File System Access permission scope > applies Chrome's local UNC path rules" passed on both (2765ms on arm64, 2707ms on x64). That covers the hostname share, the hidden $ share, the drive admin share and 127.0.0.1. On both runners the optional trailing-dot check was skipped as designed, because localhost. doesn't resolve there:

stderr | chromium.spec.ts:2094 > chromium features > File System Access permission scope > applies Chrome's local UNC path rules
Skipping \\localhost.\efsabaff5d, it does not resolve here      (windows-arm64)
Skipping \\localhost.\efsa4ed3c8, it does not resolve here      (windows-x64)

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

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review found no issues

No high-confidence issues detected in this change.

@jkleinsc
jkleinsc merged commit cc90b94 into 46-x-y Oct 26, 2026
119 of 120 checks passed
@jkleinsc
jkleinsc deleted the security-fix/46-x-y/fsa-upstream-matcher branch October 26, 2026 20:57
@release-clerk

release-clerk Bot commented Oct 26, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed File System Access blocklist gaps for .git files, shell startup and config files, and UNC shares.

claude Bot pushed a commit that referenced this pull request Oct 29, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y backport-check-skip Skip trop's backport validity checking security 🔒 semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants