PowerShell / PowerShell/Win32-OpenSSH
Fix memory corruption and support WinPE
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 8.3k
- Forks
- 819
- PR merge metrics
- No merged PRs in 30d
Description
Two distinct issues surface when running sshd on WinPE (a restricted
Windows environment with no user-profile service and no desktop /
window-station for non-interactive users). Both crash the daemon before
the user can log in.
-
load_user_profileformat-string mismatch.
Thedebug3call onLoadUserProfileWfailure declares
"%s %S %d"(three specifiers) but passes only two arguments.%S
consumesGetLastError()'sDWORDas a wide-string pointer, then
wcsnlendereferences it and crashes sshd-session post-auth. Only
visible whereLoadUserProfileWactually fails (e.g. WinPE, which
has no user-profile service), so stock Windows was unaffected. -
sshd-authcrashes on restricted window stations.
sshd-auth is a privsep helper spawned as a different user and runs
without desktop / window-station access.user32.dll'sDllMain
binds to the process window station and fails with
STATUS_DLL_INIT_FAILEDin restricted environments, so the helper
dies before auth begins. The only transitive user32 references in
sshd-auth come fromconsole.c'sConRestoreViewRect_NoPtyHack
(ShowWindow / GetWindowPlacement), which sshd-auth does not execute.
Delay-loadinguser32is sufficient: the DLL is never loaded in
practice.
Depends on PowerShell/Win32-OpenSSH#2434 (shared build changes).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the LoadUserProfileW failure logging and console.c's ConRestoreViewRect_NoPtyHack references, then inspect the shared build changes from Win32-OpenSSH#2434. Confirm the format arguments no longer corrupt memory and that user32.dll is delay-loaded so sshd-auth starts in restricted WinPE environments without loading it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100