Skip to content

fix: enforce File System Access .git/hooks write block and hypervisor UNC shares (43-x-y) - #55331

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

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

Conversation

@claude

@claude claude Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

This is the 43-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 rule for .git/hooks was 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. Unlike main, which switches Electron to upstream's matcher, this branch keeps Electron's own matcher and makes the smaller change of adding the missing checks. Following CL 8376681, suffix components are compared case-insensitively, and the UNC server handling follows CL 8424981. At this branch's Chromium version upstream applies the .git/hooks write block only to the save picker (UserAction::kSave), and the rule is Windows-only, so the practical effect here is the Windows save picker plus UNC paths. A new spec in spec/chromium.spec.ts checks that reading .git/hooks stays allowed, since the save picker cannot be driven from tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MtuMgvwAcw7t9Q6HEB31Vx


Generated by Claude Code

Notes: Fixed File System Access blocklist gaps for .git/hooks writes and hypervisor UNC shares.

@claude claude Bot added 43-x-y backport-check-skip Skip trop's backport validity checking security 🔒 semver/patch backwards-compatible bug fixes labels Oct 25, 2026
@claude

claude Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

The latest run on 5117020 (after rebasing onto 43-x-y with the ICU fix) (40400560155) had three red jobs on its first attempt, none caused by this PR. I re-ran the failed jobs once; two went green and lint is still red from the same rate limit:

  • lint: it failed before any linter ran. The step that fetches Chromium's DEPS got 429: Too Many Requests, so gclient getdep hit SyntaxError: illegal target for annotation on src/DEPS line 1. The re-run failed the same way (429: This request was rate-limited due to too many requests from your network in src/DEPS), again before any linter ran. Lint passed on today's 43-x-y pushes (40334255277, 40348484601, 40351224420) and on the 44-x-y sibling run 40400549154, so this is the network rate limit, not a lint error.
  • linux-x64-asan build: an infrastructure failure on a remote-exec worker (fork/exec ../../third_party/llvm-build/Release+Asserts/bin/clang++: no such file or directory). On the re-run the build passed, and all three linux-x64-asan test shards then passed.
  • linux-x64 test 3: only api-browser-window.spec.ts › BrowserWindow.focus() › "keeps focus in a child WebContentsView when the window regains focus" failed (expected false to be true, including retries). This PR doesn't touch that spec or BrowserWindow focus (it only changes File System Access code and chromium.spec.ts). The same shard passed on today's 43-x-y pushes 40334255277, 40348484601 and 40351224420 and on test: loosen protocol.handle "is fast" bound on branches without native relay #55346's run 40339450775. The re-run passed (1041 passed, 0 failed).

All other jobs passed on the first attempt, including every Windows and macOS test shard.

nn-test: "Run Node.js Tests" passed (All tests passed.). parallel/test-datetime-change-notify now passes (ok 613) with the ICU/tzdata fix from 43-x-y.

UNC spec: the Windows-only "applies Chrome's local UNC path rules" spec in chromium.spec.ts passed on windows-x64, windows-arm64 and windows-x86 (test 2 on each). As before, the optional \\localhost.\<share> trailing-dot check was skipped on all three because that name does not resolve on those runners, which the spec allows.


Generated by Claude Code

@claude
claude Bot marked this pull request as ready for review October 25, 2026 23:58
@release-clerk

release-clerk Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Release note looks good now.

@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. It changes the File System Access blocklist, which decides what pages may read and write on disk, so a human should still check it against Chromium at this branch's version.

What was reviewed (from a standalone clone, so I couldn't see upstream //chrome code):

  • The suffix-rule loop in ShouldBlockAccessToPath: it searches path components case-insensitively, rebuilds the path from the root to the end of each match, and checks every match.
  • The new kBlockWrite check is inside should_block_with_rule, so it covers the regular and extra rules as well as the suffix rules. Please confirm this matches upstream for any non-suffix kBlockWrite rules.
  • IsLocalUNCServer (strips one trailing dot, then compares case-insensitively), the UserAction plumbing through both blocklist-check paths, and the new read-only .git/hooks spec.
Extended reasoning...

The change touches shell/browser/file_system_access/file_system_access_permission_context.cc and its header, plus one spec in spec/chromium.spec.ts. It changes how the File System Access blocklist decides access: suffix rules are now enforced, more UNC server names count as local, and kBlockWrite rules are limited to the save picker. That blocklist is a permission boundary between web content and the local filesystem. The intended behaviour depends on upstream Chromium code that this standalone checkout doesn't contain, and the save-picker and UNC paths can't be exercised by the added spec. Because of that security surface, I'm deferring to a human instead of approving.

@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 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

failing test is fixed via #55336

… shares

Electron's copy of ShouldBlockAccessToPath() never consulted
suffix_block_path_rules_, so Chrome's Windows-only kBlockWrite rule for
*/.git/hooks was not enforced. Match Chrome's matcher at this branch's
Chromium version: plumb the UserAction into the blocklist check, apply
kBlockWrite rules only for UserAction::kSave, and evaluate suffix
rules. Suffix components are compared case-insensitively, as Chrome
does since crrev.com/c/8376681, because the rule targets Windows'
case-insensitive file system.

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.

Upstream:
- https://chromium-review.googlesource.com/c/chromium/src/+/8376681
- https://chromium-review.googlesource.com/c/chromium/src/+/8424981

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MtuMgvwAcw7t9Q6HEB31Vx
…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 force-pushed the security-fix/43-x-y/fsa-upstream-matcher branch from 705b2b4 to 5117020 Compare October 26, 2026 20:59
@jkleinsc
jkleinsc merged commit 21d45d3 into 43-x-y Oct 27, 2026
169 of 174 checks passed
@jkleinsc
jkleinsc deleted the security-fix/43-x-y/fsa-upstream-matcher branch October 27, 2026 11:01
@release-clerk

release-clerk Bot commented Oct 27, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed File System Access blocklist gaps for .git/hooks writes and hypervisor UNC shares.

shariqh added a commit to shariqh/agent-inbox that referenced this pull request Oct 28, 2026
Electron 43.8.4 updates its embedded Node.js to the v24.22.1 security
release (electron/electron#55161). The app and Setup's portable runtime now
run the same Node.

Electron 43.8.4 also fixes:
- a macOS File System Access blocklist bypass (electron/electron#54677);
- further blocklist gaps (electron/electron#55331);
- asar handling (electron/electron#55179, electron/electron#55185);
- tzdata, updated to 2026e (electron/electron#55336).

OpenSSL 3.5.9 reaches only Setup's runtime, because Electron's Node uses
BoringSSL.

- Every Electron pin moves from 43.8.3 to 43.8.4: package.json, the
  lockfile, the three release input profiles, the Windows pin constant, the
  linux-inputs hash in the AppImage and DEB contracts, tests and docs. ABI
  stays 148.
- The package's checksums.json matches the official SHASUMS256.txt (75/75),
  and #363 enforces it at build time. The binary, releases.json and
  Electron's DEPS all report Node 24.22.1 with ABI 148. src/api/hooks.cc is
  unchanged since Node 24.22.0, so the #135 fix still comes from upstream
  Node.
- Electron 43.8.4's Linux zips store most files as 0666 or 0777, and so do
  44.10.0's and 45.1.0's; the packager keeps stored modes. The Linux thin-app
  builder now clears group and other write on Electron's extracted files,
  never through a symlink. This restores 43.8.3's modes exactly.
- The AppImage's final verifier now refuses any regular file other than the
  sandbox that isn't 0644 or 0755. The DEB's verifier already did.

Follow-up: #378 (mode gates in the thin-folder verifiers).

Closes #371

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 9e7ec7a7-8690-49e5-9d55-492fedc3027a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants