Skip to content

windows: name the runner the sandbox user cannot read - #794

Open
TurtIeSocks wants to merge 1 commit into
anthropics:mainfrom
TurtIeSocks:windows-name-unreadable-runner
Open

TurtIeSocks wants to merge 1 commit into
anthropics:mainfrom
TurtIeSocks:windows-name-unreadable-runner

Conversation

@TurtIeSocks

Copy link
Copy Markdown
Contributor

Summary

When srt-sandbox can't read the runner, CreateProcessWithLogonW returns Access is denied and srt-win says to check the Secondary Logon service, which is running. npx puts srt-win.exe under the npm cache in the user's profile, so this is often the first error a Windows user sees.

  • logon::sandbox_can_read checks the exe's DACL for Users, Authenticated Users, Everyone, the sandbox account or its group
  • On Access is denied, a runner it reads as unreadable gets a message naming the file and the fix
  • Any other answer keeps the old message

Evidence

Windows 11 ARM64, srt-win exec with the runner copied to %TEMP%, through a tool that vendors this srt-win source:

  • Before: CreateProcessWithLogonW(srt-sandbox): Access is denied. (0x80070005) — ensure the Secondary Logon service (seclogon) is running.
    After: the sandbox user cannot read and execute C:\...\Temp\unreadable-runner\<runner>.exe, so Windows refuses the launch as Access is denied. Grant it read and execute, or move it to a folder the sandbox user can read.

A readable runner still runs. cargo test --lib: 197 passed, with the same pre-existing profile failure.

Merge Danger

Door: two-way

Blast Radius: one error message

Disclaimer: Code was generated by Claude 🤖 - reviewed and tested by a human 🐢

When srt-sandbox cannot read the runner executable,
CreateProcessWithLogonW fails with Access is denied (0x80070005) and
spawn_runner ended with "ensure the Secondary Logon service (seclogon) is
running", though seclogon was running. npx puts srt-win.exe under the
user's npm cache, which the profile root keeps from the sandbox user, so
this is the first error many Windows users see.

logon::sandbox_can_read reads the file's DACL and answers whether Users,
Authenticated Users, Everyone, the sandbox account or its group holds
read and execute; None when the DACL cannot be read. On E_ACCESSDENIED,
after the logon-failure, mapped-drive and seclogon arms, spawn_runner
checks the current executable with it and, when the answer is
Some(false), says the sandbox user cannot read it and how to fix that. A
Some(true) or None keeps the old message, so a miss changes nothing.

Unit tests pin each DACL shape: a grant to one account, to Everyone, a
deny taking rights back, generic rights (which a DACL read back from a
file never holds), read-data alone, and a string that is not a SID.

Checked on Windows 11 ARM64 from the desktop session: a runner copied to
%TEMP% now gets the new message naming it, and a readable runner still
runs the command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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