Skip to content

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

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

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

Conversation

@claude

@claude claude Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

This is the 45-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 8361594, CL 8376681, 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. A new spec in spec/chromium.spec.ts covers the .git/hooks write block and checks that reading it stays allowed.

🤖 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.

… shares

Electron's copy of ShouldBlockAccessToPath() never consulted
suffix_block_path_rules_, so Chrome's kBlockWrite rule for */.git/hooks
was not enforced. Match Chrome 156'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.

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/+/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/+/8424981

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MtuMgvwAcw7t9Q6HEB31Vx
@claude claude Bot added 45-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 f67bfea (40368102471) has one red job, and it isn't caused by this PR. It passed on re-run.

  • UNC spec: "applies Chrome's local UNC path rules" passed on windows-x64 test 2 (2741ms) and windows-arm64 test 2 (2802ms). On both, the \\localhost.\<share> sub-check skipped itself (Skipping \\localhost.\efsa…, it does not resolve here) because localhost. doesn't resolve on the runners. The other sub-checks ran and passed: host name allowed, hidden $ share blocked, drive admin share blocked, 127.0.0.1 blocked.
  • File System Access permission scope: all of these tests passed on every platform: linux-x64, linux-x64-asan, linux-x64-ubsan and linux-arm64 test 1, windows-x64 and windows-arm64 test 2, macos-x64 darwin and mas, and macos-arm64 darwin 2 and mas.
  • linux-arm64 test 2: no test failed (1776 passed, 997 skipped). The job went red on a vitest unhandled error: [vitest-pool]: Failed to start electron worker for test files …/api-tray.spec.ts, caused by Electron spec worker exited before it was ready (code 1, signal null). The serial half of api-tray.spec.ts had already passed. On Linux, all 29 tests in the parallel half are skipped on every other run. This shard passed on every other 45-x-y, 43-x-y, 46-x-y and main run today, so this was a one-off worker startup flake. The re-run of the job passed (1776 passed, 1026 skipped).

The asan, ubsan/js2c, app.relaunch and crash-reporter failures from the previous run did not come back on this one. Apart from the flake, every build, lint and test job passed.


Generated by Claude Code

@claude
claude Bot marked this pull request as ready for review October 25, 2026 23:54

@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.

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

…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.

Still open from earlier reviews (1):

  • Unresolved: 1 minor or pre-existing.

@jkleinsc
jkleinsc merged commit 474abf4 into 45-x-y Oct 26, 2026
118 of 120 checks passed
@jkleinsc
jkleinsc deleted the security-fix/45-x-y/fsa-upstream-matcher branch October 26, 2026 20:58
@release-clerk

release-clerk Bot commented Oct 26, 2026

Copy link
Copy Markdown

Release Notes Persisted

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

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

Labels

45-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.

4 participants