Skip to content

fix: stabilize and speed up Windows credential ACL verification - #298

Merged
kmbroai merged 3 commits into
mainfrom
dev/kyleb/windows-ci-credential-acl-flakes
Aug 7, 2026
Merged

fix: stabilize and speed up Windows credential ACL verification#298
kmbroai merged 3 commits into
mainfrom
dev/kyleb/windows-ci-credential-acl-flakes

Conversation

@kmbroai

@kmbroai kmbroai commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Retry bounded Windows credential descendant enumeration when a concurrent ambient-auth import removes a temporary file between directory traversal and lstat. A missing credential-home root, persistent instability, symbolic links, junctions, and other filesystem failures still fail closed.
  • Run the Windows-only ACL integration check through asynchronous execFile, preserving the actual subprocess error instead of surfacing only an unexplained synchronous status: null.
  • Batch credential-home ancestry, home ACL, and descendant ACL inspection into one streaming PowerShell process per validation. The same owner, trusted-SID, inheritance, attacker-writable-ancestor, descendant-privacy, alias-resolution, repair, and constrained-language checks still run on every access.
  • Keep the standard bun test --timeout 30000 timeout on every platform; the earlier Windows-only 60-second workaround is not part of the final diff.
  • Add deterministic regression coverage for disappearing descendants, repeated instability, missing roots, one-process ACL snapshots, empty homes, unsafe ancestors, unsafe descendants, incomplete subprocess output, and the default CI timeout.

Root cause

The flaky failure came from two Windows-only races: a descendant could disappear between filesystem enumeration and lstat, and the synchronous PowerShell test could occasionally return only status: null. Separately, managed credential workflows repeatedly validated the same credential home, and each validation started separate PowerShell processes for ancestry, the home ACL, and descendants. That subprocess startup cost pushed legitimate tests close to the 30-second limit.

The batching change removes the repeated PowerShell startup cost without caching or skipping ACL validation. A populated credential-home validation now uses one streaming PowerShell process for all ACL descriptors instead of separate ancestry, home, and descendant PowerShell processes; repair paths still re-inspect after mutation.

Failure evidence

Verification

  • The new disappearing-descendant and persistent-instability regressions failed against the original implementation, then passed with the bounded retry.
  • The combined-inspection regression failed before the batching implementation, then passed with the single-process snapshot path.
  • Randomized local SDK suite after batching (--randomize --seed 12345 --timeout 30000): 950 passed, 10 platform-specific skips, 0 failed.
  • TypeScript typecheck, generated-model validation, full Prettier check, production build, pnpm pack, and installed-package smoke validation passed.
  • Current GitHub Actions run: https://github.com/openai/codex-security/actions/runs/31205123609
  • All 11 applicable checks passed, including Windows Node 22 and Node 24; 5 publication checks were intentionally skipped.
  • Windows Node 24 passed 972 tests with the default 30-second timeout. The formerly slow parallel-scan test improved from 25.02s to 14.46s, delegated credential login from 30.87s to 17.70s, and the full Windows suite from 399.86s to 328.22s despite the combined PR running more tests.
  • Windows Node 22 passed 972 tests with the default 30-second timeout; hostile ancestor rejection, nested credential ACL repair, and constrained PowerShell regressions passed on both Windows jobs.

@github-actions github-actions Bot added the bug Something isn't working label Aug 7, 2026
@kmbroai kmbroai changed the title fix: stabilize Windows credential ACL verification fix: stabilize and speed up Windows credential ACL verification Aug 7, 2026
@kmbroai
kmbroai merged commit d4ee447 into main Aug 7, 2026
17 checks passed
@kmbroai
kmbroai deleted the dev/kyleb/windows-ci-credential-acl-flakes branch August 7, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants