Repository navigation
fix(startup): read the install-dir package ACL as SDDL so a repaired folder reads clean on Chinese/Japanese/Korean Windows - #22490
Conversation
…tree reads clean on every Windows language The Windows install-dir permission probe parsed icacls's display output and recognized the well-known package grants by their English names. On Chinese/Japanese/Korean Windows icacls keeps 'NT AUTHORITY' in English but translates the package names, so a tree the repair had just fixed read as poisoned AND reliable: the pre-window repair re-armed every launch, the dialog blamed the install, and the safe-graphics fallback was withheld. Read the DACL with 'icacls <target> /save <tmpfile>' instead, which writes SDDL (SIDs, AC alias) on every locale, and drop the English-name heuristic and its wellKnownNameCheckReliable flag.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughThe Windows install-directory ACL probe now reads ACL data from a temporary file created with Priority: ➖ Normal Merge Risk: 🔵 Low · up to An interrupted ACL read can incorrectly trigger install-directory repair. Require a complete saved record before classifying it; the risk is narrow but worth fixing. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change is confined to Windows install-folder permission detection and its existing repair path. No newly introduced security issue was established, but incomplete permission readings can still affect recovery decisions. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
ℹ️ No critical issues — one parsing edge worth a look.
Reviewed changes
- SDDL-based ACL probe —
windows-install-dir-acl-probe.tsnow runsicacls <target> /save <tmpfile>, reads it as UTF-16LE, and matches package ACEs by SID / theACalias instead of localized display names. - Verdict trust widened —
isInstallDirAclPoisonVerdictdrops thewellKnownNameCheckReliableguard (and the probe stops emitting it), so a positive reading is trusted on every Windows display language. - Fixtures and tests rewritten — the shared fixture emits SDDL
/savefiles, with verbatim real-Windows capture tests; the probe, recovery, repair, and gpu-lifecycle guard suites are updated.
The core fix is sound: icacls /save genuinely prints locale-independent SDDL, AC is confirmed as SDDL_ALL_APP_PACKAGES (S-1-15-2-1), deny and inherit-only ACEs are correctly excluded from grants, and readFileSync(..., 'utf16le') fails safe (no D: → unreadable → no repair and no blame). All 86 tests in the four changed suites pass locally.
ℹ️ Nitpicks
- The
zhDisplayargument in the CJK test (windows-install-dir-acl-probe.test.ts:117-136) is never consumed: the probe always invokes/save, andfakeIcaclsSpawnonly emitsdisplayfor non-/saveverbs. The test therefore pins "an SDDL tree with the restricted grant reads clean", not the translated-name display it is named for. Worth dropping the dead argument or renaming the case so the comment matches what it actually exercises.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Crash scan 22 data point (v1.4.209, Windows 11 22000, Intel UHD 27.20.100.9664): on the first launch after the auto-update to 1.4.209, GPU and renderer both exited -2147483645 within 500 ms of start (main_window_load_failed ERR_FAILED). The next launch, 4 s later, logged |
|
Another field case on v1.4.205 (Slack report, Windows):
The repair worked, but afterwards the probe kept reporting the folder as poisoned and called that reading reliable. That is the false positive this PR fixes. The bundle has no locale data, so I can't confirm this is the translated- |
|
Scan-24 field repeat on v1.4.211: report cbf496d6 (Windows 10 19045). matchesPoisonSignature=true with 2 orphan package SIDs and no well-known grant, so GPU and renderer died at init with 0x80000003. The shipped repair fixed it on the next launch (status ok, 0 failed files). Separately, 6a77940c (same exit code, on non-English Windows) had orphanPackageSidCount=0, so it is not this signature; it was a transient first launch after the update. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: e7e8c146-ea32-450c-ba3f-c0c25a5bae99
📒 Files selected for processing (2)
src/main/startup/windows-install-dir-acl-probe.test.tssrc/main/startup/windows-install-dir-acl-probe.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Partial DACLs now rejected instead of truncated —
collectAclFactsreturnsnullwhen the anchored/^D:[A-Z]*((?:\([^()]*\))*)(?:S:.*)?$/imcapture cannot consume the wholeD:line, so a conditionalXA/XDor resource-attributeRAACE no longer silently drops every following ACE. - Unreadable probe result derived from parsed facts —
runProbefilters outnullfacts and reportsstatus: 'failed', reason: 'all-targets-unreadable'only when no target parses, replacing the previousoutputs.every((out) => out === '')check that treated nonempty-but-malformed output as a clean DACL. - Two regression tests added — one pins that a conditional ACE keeps the DACL unreadable rather than hiding a later
S-1-15-2-2grant (the prior false-poison path), the other pins that a bare leaf-name header is not reported as clean.
The prior inline concern about the unanchored DACL capture is resolved by this delta: a partial parse can no longer produce a verdict, so the false-alarm path that the removed wellKnownNameCheckReliable guard used to suppress is closed at the source. All 88 tests in the four changed suites pass locally.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
On Chinese, Japanese or Korean Windows, Orca could keep saying its installation permissions were broken after it had repaired them. The check now reads language-independent permission IDs.
What Changed
Read the DACL saved by
icacls /saveinstead of parsing translated account names from its display output. Recognize package grants by SID, excluding deny and inherit-only entries. Delete the temporary UTF-16 save file after reading it. Require successful process exit before reading the saved output. Reject incomplete or unsupported DACLs as unreadable instead of treating a partial parse as proof that the installation is broken.Before, a repaired folder could trigger repeated repair attempts, administrator instructions and suppression of the graphics fallback. After, a readable repaired folder is recognized correctly in every locale.
Why
Adding translated names is incomplete and fragile. SDDL provides stable identifiers with the existing Windows tool, without another interpreter or native dependency. The regression proves incorrect permission detection; it does not prove that every reported Windows graphics crash has this cause.
Linked Issue
Crash Scan 21 and attached field evidence; related upstream issue: electron/electron#51761.
Visual Proof
N/A — startup permission detection only; no new UI.
Testing
Review
The original partial DACL parser could produce a false alarm when a conditional ACE preceded a valid grant. The follow-up fixes this by refusing unsupported DACLs. The final review also caught failed exports leaving apparently valid output; nonzero/signal exits now discard that output. Previous CI passed except main’s stale terminal hook snapshot, fixed by #23090 and passing locally after refresh. Full CI reruns on the final head.
Agent skill upstream boundary
Notes
Windows-only behind existing runtime checks. Other platforms, SSH execution, Git/folder workspace handling and remote protocols are unchanged. An unreadable DACL cannot authorize repair; existing failure handling remains in place.
Checklist