Skip to content

WIP: Investigate Windows protected snapshot launch - #560

Draft
JusterZhu wants to merge 9 commits into
justerzhu-ordered-report-lifecyclefrom
justerzhu-windows-protected-image-lease
Draft

JusterZhu wants to merge 9 commits into
justerzhu-ordered-report-lifecyclefrom
justerzhu-windows-protected-image-lease

Conversation

@JusterZhu

@JusterZhu JusterZhu commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Status

Experimental only; do not merge as a security feature. The snapshot and launcher prototypes compile only with WINDOWS_SNAPSHOT_LAUNCH_EXPERIMENT. The default build exposes neither prototype. No production launch API or peer authentication is delivered. The base is #559 at 7c53fec00be60ddd7eab3a935550db1e413c017c.

Evidence

  • On Windows, the prototype atomically creates a protected-DACL private snapshot, copies and hashes individually authorized files, holds file and directory handles, and uses CreateProcessW with no handle inheritance, creation-time job-list assignment and kill-on-close.
  • At a33e172623888bbd779a166c435d5da94e7bdf81, Native AOT CI published and launched the staged cooperative peer with individually authorized SQLite, checked the loaded SQLite path, exercised cancellation and verified bad image hash rejects launch. Earlier experiments verified owner termination, restricted handle inheritance and shared-open conflict semantics.
  • Local tests also observed a previously opened DELETE handle rejecting the source lease with Win32 32 and an ancestor junction being rejected.
  • Directory sharing does not prevent changes through an existing WRITE_DAC handle or creation of children. Protected inheritance and private creation are required; these tests are not proof for arbitrary deployment paths.

Unresolved security conditions

CreateProcessW loads static imports before cooperative code runs. The prototype restricts cwd and PATH but does not validate and lock the complete actual Windows system DLL closure, including API-set, forwarded and side-by-side resolution. A writable system DLL or previously granted security-modification handle is not excluded by the current code. Do not treat system directory names, a later ACL check or a successful test as proof. System dependencies require a defensible, verified object-level loading boundary or an explicitly authorized OS trust prerequisite.

The prototype also needs a full review of exceptional/cancellation ownership, identity-safe normal cleanup and product-level cross-process race and handle-inheritance coverage. Normal disposal currently leaves the private snapshot, as can a crash. Staging changes the executable and working directories; the host must separately provide installation context. The caller must pin a cooperative peer whose trusted entry limits DLL loads; this is not a sandbox for arbitrary native code. No credentials, IPC, Client integration or #554/#558 guard changes are included.

Earlier experiments: handle inheritance, DLL search, SQLite and static imports, job lifetime.

JusterZhu and others added 9 commits November 23, 2026 16:35
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant