Repository navigation
fix(windows): report the ACE count a private DACL check observed - #14450
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Low impact] The PR appears safe to merge; the remaining test-coverage finding is non-blocking. Findings
Fix with agent prompt### Issue 1
native/windows/src/filesystem.cc:238-249
The new diagnostic text has no regression coverage. Existing success checks cannot show that the three trustee refusals include the observed values. Add refusal tests for an unexpected ACE count, an unrelated principal, and a missing expected trustee. Assert the suffix and unchanged `ERROR_ACCESS_DENIED` result so future edits cannot silently remove the information this PR adds.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryAdds the observed ACE count, DACL protection flag, and whether the token user equals SYSTEM to three Windows trustee-refusal messages.
Reviews (2) · Last reviewed commit: "fix(windows): report the ACE count a pri..." · Reviewed by Greptile |
95e160b to
2748e77
Compare
ec61e2e to
701c5fb
Compare
|
thanks! merged after a clean review, passing C++ regression, and green Windows CI. |
* commit '4ccc685dd5ed028bc625fdd8760539ce5a492d8d': (228 commits) test(asar): verify cleanup on the original file handle (morluto#15155) fix(ubi): bound smaller-grid probe memoization (morluto#15168) fix(artifacts): distinguish content from containment changes (morluto#15165) fix(bflt): retain complete text when data is truncated (morluto#15160) refactor(domain): reuse graph projection and validation helpers (morluto#15173) fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801) test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172) test(beam): reuse the CLI Evidence reader (morluto#15171) test(oci): share descriptor budget refusal assertions (morluto#15159) refactor(audit): share byte framing for offline audit logs (morluto#15162) refactor(evidence): reuse observed file reports for binary metadata (morluto#15161) fix(doctor): omit package-runner cache shims from installations (morluto#15059) refactor(packages): share package inspection budget contracts (morluto#15158) refactor(desktop): share completed command answer recovery (morluto#15156) refactor(views): share page byte reservations (morluto#15152) refactor(artifacts): share GPU and media asset layout rules (morluto#15150) fix(setup): name the detected host when Hopper setup does not apply (morluto#14449) fix(iso9660): read a directory record whose identifier padding byte is not zero (morluto#15020) fix(windows): report the ACE count a private DACL check observed (morluto#14450) fix(artifacts): read Ogg Opus channel mapping tables (morluto#14975) ...
* commit 'e18ed55bac14191010efe91ba61489cab1d2ba55': (137 commits) fix(artifacts): report macOS package bundle release versions (morluto#14860) test(asar): verify cleanup on the original file handle (morluto#15155) fix(ubi): bound smaller-grid probe memoization (morluto#15168) fix(artifacts): distinguish content from containment changes (morluto#15165) fix(bflt): retain complete text when data is truncated (morluto#15160) refactor(domain): reuse graph projection and validation helpers (morluto#15173) fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801) test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172) test(beam): reuse the CLI Evidence reader (morluto#15171) test(oci): share descriptor budget refusal assertions (morluto#15159) refactor(audit): share byte framing for offline audit logs (morluto#15162) refactor(evidence): reuse observed file reports for binary metadata (morluto#15161) fix(doctor): omit package-runner cache shims from installations (morluto#15059) refactor(packages): share package inspection budget contracts (morluto#15158) refactor(desktop): share completed command answer recovery (morluto#15156) refactor(views): share page byte reservations (morluto#15152) refactor(artifacts): share GPU and media asset layout rules (morluto#15150) fix(setup): name the detected host when Hopper setup does not apply (morluto#14449) fix(iso9660): read a directory record whose identifier padding byte is not zero (morluto#15020) fix(windows): report the ACE count a private DACL check observed (morluto#14450) ...
��## Summary
When
verifyPrivateinnative/windows/src/filesystem.ccrejects a private directory or file because its DACL trustee set does not match the expected two-ACE(current user, SYSTEM)contract, the thrown failure reported only the static constraint string without the observed ACE count, protection flag, or whether the process token user already equalsSYSTEM.This adds structured readback details (
ace_count,protected,token_user_equals_system) to the three trustee-set refusals inverifyPrivateto diagnose #5237 without relaxing any Windows ACL security check. Rebased over #14769 (62a4bee42), which resolved the exclusiveelse ifbranch when two ACEs belong toSYSTEM(observeAce(isUser, isSystem)preserves that independent two-flag behavior); this PR covers the remaining structured readback onace_count != 2(includingace_count=1orace_count=3+), unrelated-principal, and missing-trustee refusals. Supersedes #10319 on a clean single-commit branch over currentmain(and does not include the closed #9182 experiment from #10318). Does not close #5237 because the root cause on the reporter's Windows host still needs the diagnostic output.Problem and expected behavior
In #5237,
Private DACL contains unexpected trustees(ERROR_ACCESS_DENIED) was raised immediately after REA created its own private directory, without revealing whether Windows read backace_count=1(for example when the token user isSYSTEMor an antivirus/filter injected an extra ACE),ace_count=3+, or an unexpected protection bit.Expected behavior:
verifyPrivateenforces the exact same two-trustee protected DACL invariant andERROR_ACCESS_DENIEDerror code, and appends; ace_count=<N|absent> protected=<0|1> token_user_equals_system=<0|1>to the three trustee-check failure messages (Private DACL contains unexpected trustees,Private DACL permits an unrelated principal, andPrivate DACL must allow only current user and SYSTEM). No SIDs, usernames, or paths beyond the existing failure path are exposed.Change and scope
Extracts
PrivateDaclTrusteeVerifierandformatPrivateDaclTrusteeReadbackinnative/windows/src/private_dacl.hppand uses them for the three trustee-set refusals inverifyPrivate(native/windows/src/filesystem.cc). Ownership, DACL presence/protection, ACE type/flags/mask checks, andERROR_ACCESS_DENIEDsemantics are unchanged.Follow the contribution scope.
Not applicable. Diagnostic error detail inside existing Windows private-directory verification; no authority or security boundary relaxation.
Contract and boundary impact
PrivateDaclTrusteeVerifier(native/windows/src/private_dacl.hpp) consumed byverifyPrivate(native/windows/src/filesystem.cc). Downstream native addon error propagation is unchanged.docs/public/product-catalog.json), package, or installation impact: Windows native C++ source change verified by CINative package baselineandWindows capability and package lane.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
native/windows/src/private_dacl_test.ccandsrc/windows/WindowsPrivateDacl.test.tscompile and execute C++17 unit tests covering all three trustee refusal paths (unexpected trusteesincludingace_count=1,ace_count=3, andace_count=absent;unrelated principal; andmust allow only current user and SYSTEMwhen two ACEs match the same principal ortoken_user_equals_system=1), asserting both the exact diagnostic suffix andERROR_ACCESS_DENIED(win32Code == 5).scripts/verify-windows-native.mjsexercises real NTFS protected-directory refusals throughcutter_bridge_verify_directoryfor an unexpected three-trustee DACL and an unrelated-principal two-ACE DACL, assertingEACCES,win32Code === 5, and exactconstraintreadback strings on the Windows CI runner.native/windows/src/filesystem.ccfor [Windows native] Private DACL contains unexpected trustees (Win32 5) blocks Android inspection before JADX #5237 (require(acl->AceCount == 2, "Private DACL contains unexpected trustees", path, ERROR_ACCESS_DENIED)discardedacl->AceCount,control, andEqualSid(expected.userSid(), expected.system.data())).Private DACL contains unexpected trustees; ace_count=3 protected=1 token_user_equals_system=0.rea-windows-x64.nodelocally (native/windows/README.md#build); full native addon cross-compilation andscripts/verify-windows-native.mjsrun in GitHub Actions (Native package baseline+Windows capability and package lane).Boundary and lifecycle regressions: not applicable;
verifyPrivateresource handles (LocalFreeviadescriptorRAII) and failure exit paths are unchanged.For evidence-bearing changes:
Validation performed
npx vitest run src/windows/WindowsPrivateDacl.test.ts� passed (g++ -std=c++17 -Wall -Wextra -WerrorC++17 refusal assertions).npm run typecheck,npx oxlint -c .oxlintrc.json --quiet,npx oxfmt --check,npm run verify:architecture-guards, andnpm run verify:module-boundaries� passed locally.Native package baseline(Linux MinGW cross-build) andWindows capability and package lane(scripts/verify-windows-native.mjs) � verified in CI.Compatibility, safety, and release
ERROR_ACCESS_DENIED) and prefix (Private DACL ...) are preserved.rea-windows-x64.nodeon next native build/release.protected/token_user_equals_systemflags without leaking SID strings or environment data.Author readiness
Human owner: @liziye627-design
Author checklist (completed by the PR author before requesting review)
type(scope): outcome.REA_runtime setting with a default, floor, and maximum, unless a fixed ceiling has a stated reason. See Adding a runtime setting.