Repository navigation
v50 patch 4
v50 patch 4
ScriptVersion 50 · ScriptPatchLevel "4"
Ten fixes across the full-update failure paths, the trust-check helper's three copies, and the resume-task lifecycle. ScriptVersion remains 50; no DesiredStateId change; no fleet-wide rebuild. A machine that ran v50 patch 3 continues on the fast path.
Fixed
-
Step 5 deployment fails closed on an indeterminate WinRE status. The full-update Step 5 deployment region had no
elsebranch whenreagentc /inforeturned a status the parser could not classify. An indeterminate status now exits FATAL with the resume task preserved — the fifth instance of the fail-closed defect class named in.NOTESsince v49 patch 2. -
Twelve additional failure exits preserve the resume task. Every full-update exit where the operation has changed recovery state but cannot positively verify an acceptable final recovery route now sets
$Script:ResumeTaskShouldPersist = $true. The persist-site total is now eighteen. The invariant: when the operation has changed recovery state and cannot positively verify an acceptable final route, the resume task must not be unregistered. -
Int32 overflow in
Get-PartitionPlansize arithmetic. The vulnerable[Math]::Max(0, …)form threw on a >2 GiB delta (Surface Pro 3, 2026-10-16, ~4.9 GB extend), and every subsequent invocation crashed identically, defeating the self-healing resume task. Replaced with explicit-gtcomparisons on[int64]operands. -
Internal-bus scoping on
Remove-StrayRecoveryPartitions. The non-OS-disk recovery-partition sweep now applies the same internal-bus allowlist as the workspace selector. Type-coded recovery partitions on USB, SD/MMC, iSCSI, Fibre Channel, and unknown-bus disks are preserved individually. Field-verified on ASUS 2026-10-19: the JMicron JMS539 USB disk was preserved as expected. -
Reparse-safe staging-directory cleanup.
Remove-StagingDirectorySafelyenumerates expected children and deletes them individually, refusing reparse points, subdirectories, unexpected content, and non-directory paths. Replaces theRemove-Item -Recurseform that could follow an NTFS junction into an attacker-chosen target. -
Warn-only parent-chain trust check.
Initialize-ResumeScriptStaginglogs a WARN whenC:\Recovery\OEMorC:\Recoveryfails the SYSTEM trust policy but does not refuse registration. The residual — a non-admin withModifyon the parent chain replacing the staged directory between registration and execution — is documented inSECURITY.mdas accepted, not closed. Field-observed on ASUS 2026-10-19: the warning fired on a user-ownedC:\Recovery\OEM, staging proceeded, and the task registered and cleaned up correctly. -
Resume-task lifecycle flags. Two new script-scope flags (
$Script:ResumeStagingTaskInvalid,$Script:ResumeTaskCompromiseUnresolved) force a FATAL exit atMainwhen staging safety cannot be verified and an existing task cannot be positively confirmed as removed. -
Foreign-source reporting correction. The
Foreign-With-Driverspreserve branch'sNextActionnow distinguishes image preservation from WinRE registration status.
Changed
-
InheritOnly ACE skip in
Test-PathTrustedForSystem(three copies).CREATOR OWNERandCREATOR GROUPare deliberately not added to the trusted SID list — the fix is to skip ACEs that do not apply, not to trust their principals generally. The identical logic exists inWinRE.ps1,Cleanup-Backups.ps1, and the inline_Thelper inWinRE-Manager.cmd's RESTORETARGET_COMMAND; any future change must land in all three (maintainer commitment recorded inCONTRIBUTING.md). -
Harness v39. Check 18 tightened to require the specific
Get-Disk -ErrorAction Stopenumeration and itsWhere-Objectfilter; checks 21 (source pattern) and 22 (behavioral Int64 regression) added.
Migration
ScriptVersion remains 50, ScriptPatchLevel moves from "3" to "4". No DesiredStateId change; no fleet-wide rebuild. A machine that ran v50 patch 3 continues on the fast path.
Rollback: change $ScriptPatchLevel back to "3" and revert the v50 patch 4 changes.
Field verification
Field-verified on the project's ASUS desktop test machine (PRIME H510M-D, i5-11400, Windows 11 build 26300) on 2026-10-19:
- Fast-path run: SUCCESS, 12s,
Operating mode: DEDICATED - Warn-only parent chain: fired on user-owned
C:\Recovery\OEM, staging proceeded, task registered and cleaned up - Internal-bus scoping: preserved the JMicron JMS539 USB disk (disk 5)
- Elevated
Test-WinRE.ps1 -NonInteractive: 27/27, including check 18 (tightened), 21, 22 - Backup: SUCCESS. Restore short-circuit: fired correctly twice.
Full record
See CHANGELOG.md for the complete per-fix description and the pending-verification list.