Skip to content

Create and verify private Windows runtime DACLs #290

Done

Description

@morluto

Problem Statement

PrivateRuntimeRoot and Ghidra's runtime files use POSIX mode requests such as 0700 and 0600. On Windows these mode values do not establish or verify a current-user-only DACL. The inherited ACL on the temporary parent therefore determines access to session descriptors, request tokens, endpoint records, snapshots, logs, and Ghidra project data.

The authenticated loopback protocol protects requests only if its token and session material remain private. REA currently documents this gap and declines to claim private-DACL enforcement.

Purpose and Benefit

Create a real Windows private-runtime boundary whose access policy is established by REA and verified from the resulting security descriptor.

This would:

  • protect session authentication material from other local principals;
  • give snapshots, logs, project files, and endpoint records one inherited security policy;
  • provide the ACL machinery needed by a future protected named-pipe transport; and
  • let capability reporting distinguish verified private storage from ordinary temporary-directory creation.

Proposed Direction

Extend the platform runtime-root adapter to create a directory with a protected DACL that grants only the current user and SYSTEM the access required for the session. Child files and directories should inherit the intended policy.

After creation, read the security descriptor back by handle and verify at least:

  • owner identity;
  • DACL presence and protected/inheritance state;
  • the admitted trustees and rights;
  • absence of null-DACL or broad allow entries; and
  • security support on the backing filesystem.

Creation and readback belong in the Windows native adapter from #287. Ghidra should receive only a verified private runtime root, not manipulate ACLs itself.

Desired Outcome

  • Windows runtime roots fail closed when the requested DACL cannot be created or read back.
  • Session descriptors, endpoint records, snapshots, logs, and project directories inherit or receive the verified policy.
  • A hostile permissive parent ACL does not broaden access to the runtime tree.
  • Capability and doctor output report verified availability and actionable failures.
  • Real Windows tests run as a non-administrator and verify allowed current-user/SYSTEM access plus denied unrelated-user access.
  • Cleanup remains idempotent and does not follow links outside the owned runtime tree.

Constraints and Non-goals

  • Depends on Define a trusted Windows native authority and packaging boundary #287.
  • Do not use chmod success as Windows ACL evidence.
  • Avoid icacls or PowerShell orchestration as the authority boundary; creation and verification should be handle-based and race-aware.
  • Named-pipe transport can reuse this capability later but is not part of this issue.

Evidence and References

Activity

  1. added
    enhancement
    P1: high
    roadmap
    on Jul 16, 2026
  2. morluto commented on Jul 17, 2026

    @morluto
    OwnerAuthor

    Status after #287 packaging research: this remains active and depends on the handle/file-identity boundary in #289. Private runtime-root DACL creation and verification should be performed by handle, preserve typed diagnostics, and be proven by the real non-admin Windows verifier. It should not duplicate path-opening logic from #289.

  3. morluto commented on Jul 17, 2026

    @morluto
    OwnerAuthor

    Current-main contract update (2026-07-17):

    The provider-neutral sealed-root boundary now parses DACL observations before publishing a WindowsPrivateRoot. It distinguishes five object classes:

    • root directory;
    • read-only directories;
    • read-only files;
    • writable directories; and
    • writable files inherited from a protected writable parent.

    Each class commits object kind, explicit/inherited ACE disposition, propagation, owner, exact admitted trustee vocabulary, current-user/SYSTEM/OWNER RIGHTS semantics, verified object count, descriptor digest, and path-to-policy manifest digest. A versioned enclosing digest binds those five records to both the projection manifest and launch commitment. The parser cross-checks file/directory counts, rejects class/rights/propagation contradictions, null or broad DACL reports, additional trustees, malformed/unknown fields, and cross-projection security-manifest reuse, then poisons/closes malformed native tokens.

    Independent review also exposed a stronger unresolved boundary: changing a DACL after construction cannot revoke write, delete, WRITE_DAC, or mapped-section rights already held by another same-user process. ADR-0004 now rejects “seal later.” The native design must apply final descriptors at creation or establish another proven construction principal/capability, close every mutation-capable construction handle before commit, and pass pre-open race tests. #290 can establish privacy against unrelated local principals, but it cannot silently satisfy same-user immutable launch authority.

    Focused coverage now exercises the accepted five-class report plus rejection of null DACLs, broad/additional trustees, wrong owner/SYSTEM/OWNER RIGHTS, wrong protection/propagation/rights, malformed digests, unknown fields, count drift, security-digest drift, and projection-manifest substitution. The exact tree passes npm run check, including all 160 test files, generated docs, build, typecheck, lint, and formatting.

    This issue remains open for the native descriptor creation/readback implementation, non-administrator unrelated-user access proof, cleanup proof, capability/doctor wiring, and the explicitly separate same-user construction-race decision.

  4. morluto commented on Jul 20, 2026

    @morluto
    OwnerAuthor
  5. added
    area: runtime
    on Oct 14, 2026
  6. added
    area: tests
    and removed on Nov 23, 2026
  7. morluto commented on Nov 24, 2026

    @morluto
    OwnerAuthor

    Closing as implemented: private Windows runtime DACLs are created via NtCreateFile with SE_DACL_PROTECTED permitting only the current user and SYSTEM (FILE_ALL_ACCESS) and verified by handle readback via GetSecurityInfo in native/windows/src/filesystem.cc (Security, createRelative, verifyPrivate), exposed through src/windows/WindowsPrivateRuntime.ts and src/process/PrivateRuntimeRoot.ts, reported by src/ghidra/GhidraDoctor.ts and src/process/WindowsAuthority.ts, and verified on real Windows with an independent SID-based .NET DirectorySecurity check in scripts/verify-windows-native.mjs (privateRuntimeAclObserver) (landed in PR #699 / 26881da76a).

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

Metadata

Metadata

Assignees

Labels

P1: higharea: runtimearea: testsenhancementroadmap

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions