fix(windows): grant owner ACE before ACL inheritance removal - #601
Conversation
/inheritance:r drops inherited ACEs immediately. Doing that before an explicit current-user Full Control grant left atomic-write temps with a protected zero-ACE DACL when a later icacls step timed out (lidge-jun#596).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughWindows ACL hardening now grants the current user Full Control before disabling inheritance and removing broad grants. Tests cover command ordering, grant failures, and timeout behavior during broad-grant removal. ChangesWindows ACL hardening
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant runIcacls
participant icacls
participant WindowsTempFile
runIcacls->>icacls: grant current-user Full Control
icacls->>WindowsTempFile: establish explicit owner ACE
runIcacls->>icacls: remove inheritance
icacls->>WindowsTempFile: protect inherited ACL state
runIcacls->>icacls: remove broad grants and verify with /findsid
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Review verdict: merge-readyContextImplements the fix proposed in #596: grant current-user Full Control before Issue thread had no separate maintainer comment beyond the detailed reporter proposal (which this PR follows). Bots
CIAll green: ubuntu / macos / windows, npm-global ×3, react-doctor, enforce-target, label. Bug reviewNo shippable defects. Order is grant → inheritance → remove-broad; grant failure leaves inheritance untouched; Security reviewNo medium+ findings. End-state isolation unchanged (same broad SIDs + Local
Holding merge per request. Ready when you want it squashed. |
|
To use Codex here, create an environment for this repo. |
Summary
auth.json/config.json/responses-state.json.tmp) with a protected zero-ACE DACL after/inheritance:rran and a latericaclsstep timed out.runIcacls()to grant current-user Full Control first, then/inheritance:r, then broad-SID/remove:g(with existing/findsidverification).Why
/inheritance:ris destructive (drops inherited ACEs immediately). Microsoft/docs + field reports agree an empty DACL denies ordinary access; owner implicit rights are not enough for reliable cleanup. Related: #160 (timeout honesty), #499 / #502 (stale-temp recovery — complementary, cannot open a zero-ACE temp).Test plan
bun test tests/windows-secret-acl.test.ts— 28 pass (success-order + remove:g-timeout owner-ACE + grant-first EPERM)bun run typecheckbun run privacy:scanCloses #596
Summary by CodeRabbit