Skip to content

Commit c7782e0

Browse files
committed
test(windows-bundle): pin the install.ps1 hand-off, not the bypass flag
The contract asserted the literal "powershell -ExecutionPolicy Bypass -File" appeared in cbm_cmd_update, so removing that string from the binary reddened every test leg on every platform — the contracts run as step 0 of scripts/test.sh, so one violation stops the matrix before a single suite executes. 13 checks, one cause. The contract's stated intent is that the Windows update command "must hand off to install.ps1 and must NOT carry an in-process self-update path". The bypass flag was never that property, only the literal form the command happened to take. The assertion now pins the hand-off itself ("powershell -File" plus install.ps1), which is what the comment always claimed to protect. Adds the inverse assertion in the same place: the printed command must NOT contain an execution-policy override at all. Without it this contract would silently permit the pattern coming back, and the whole point of removing it was that a shipped binary is the wrong place to carry a canonical loader signature. Process note for myself: I ran the cli suite and lint before pushing, but not the contracts — which is precisely the gap recorded as "scripts/test.sh runs them as step zero of EVERY leg, so one violation reddens all 30 CI jobs". Ran the full contract set this time. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 1b8beb2 commit c7782e0

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎tests/test_windows_bundle_contract.sh‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,9 +749,20 @@ update_windows_block = (
749749
require(
750750
update_start >= 0
751751
and "install.ps1" in update_windows_block
752-
and "powershell -ExecutionPolicy Bypass -File" in update_windows_block,
752+
and "powershell -File" in update_windows_block,
753753
"cbm_cmd_update must print the install.ps1 command on Windows",
754754
)
755+
# The printed command must NOT carry an execution-policy override. That is a
756+
# canonical malicious-loader pattern, and emitting it as a string literal put
757+
# the signature inside every Windows artifact we ship — to save the user one
758+
# documented step. The hand-off above is the property this contract cares
759+
# about; the bypass flag was only ever the literal form it happened to take.
760+
# Unblock-File covers the common case and the README covers the rest.
761+
require(
762+
"ExecutionPolicy" not in update_windows_block,
763+
"cbm_cmd_update must not print an execution-policy override "
764+
"(document it instead of shipping the pattern in the binary)",
765+
)
755766
require(
756767
"cbm_windows_launcher" not in cli_source
757768
and "windows_launcher_state.h" not in cli_source,

0 commit comments

Comments
 (0)