Fix: Windows uninstaller re-adds package bin path to PATH#6458
Open
jedisct1 wants to merge 1 commit intowasmerio:mainfrom
Open
Fix: Windows uninstaller re-adds package bin path to PATH#6458jedisct1 wants to merge 1 commit intowasmerio:mainfrom
jedisct1 wants to merge 1 commit intowasmerio:mainfrom
Conversation
SUMMARY
The Windows uninstall hook removes `{app}\bin` from PATH but mistakenly calls `EnvAddPath` for `{app}\globals\wapm_packages\.bin`, leaving that stale path behind after uninstall.
PROVENANCE
This exploration and report were automatically generated by the Swival Security Scanner (https://swival.dev).
PRECONDITIONS
- The Windows installer is used to install Wasmer.
- The product is later uninstalled, triggering `CurUninstallStepChanged`.
PROOF
1. Input/source/state origin: installation adds both `{app}\bin` and `{app}\globals\wapm_packages\.bin` to PATH in `scripts/windows-installer/wasmer.iss:79-85`.
2. Control-flow and data-flow path: uninstall runs `CurUninstallStepChanged` in `scripts/windows-installer/wasmer.iss:88-95`.
3. Failing condition or violated invariant: the uninstall hook removes `{app}\bin` with `EnvRemovePath(...)` at line 92, but line 93 calls `EnvAddPath(...)` for `{app}\globals\wapm_packages\.bin` instead of removing it.
4. Resulting impact: uninstall leaves a dead Wasmer path in the user PATH variable, so command resolution and environment state remain incorrect after removal.
5. Why this is reachable in the current code: `CurUninstallStepChanged` is the tracked uninstall handler, and the wrong function call is unconditional inside its `usPostUninstall` branch.
WHY THIS IS A REAL BUG
This is a real lifecycle bug in shipped installer logic: uninstall mutates PATH in the wrong direction, leaving stale machine state behind.
PATCH RATIONALE
The patch changes the single incorrect `EnvAddPath` call to `EnvRemovePath`. It is the smallest fix and only affects uninstall cleanup.
RESIDUAL RISK
None
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a Windows uninstaller lifecycle bug where the uninstall hook removed {app}\bin from PATH but mistakenly re-added {app}\globals\wapm_packages\.bin, leaving a stale entry after uninstall.
Changes:
- Replace an incorrect
EnvAddPathcall withEnvRemovePathin the uninstall step handler to properly clean upPATH.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
The Windows uninstall hook removes
{app}\binfrom PATH but mistakenly callsEnvAddPathfor{app}\globals\wapm_packages\.bin, leaving that stale path behind after uninstall.PROVENANCE
This exploration and report were automatically generated by the Swival Security Scanner (https://swival.dev).
PRECONDITIONS
CurUninstallStepChanged.PROOF
{app}\binand{app}\globals\wapm_packages\.binto PATH inscripts/windows-installer/wasmer.iss:79-85.CurUninstallStepChangedinscripts/windows-installer/wasmer.iss:88-95.{app}\binwithEnvRemovePath(...)at line 92, but line 93 callsEnvAddPath(...)for{app}\globals\wapm_packages\.bininstead of removing it.CurUninstallStepChangedis the tracked uninstall handler, and the wrong function call is unconditional inside itsusPostUninstallbranch.WHY THIS IS A REAL BUG
This is a real lifecycle bug in shipped installer logic: uninstall mutates PATH in the wrong direction, leaving stale machine state behind.
PATCH RATIONALE
The patch changes the single incorrect
EnvAddPathcall toEnvRemovePath. It is the smallest fix and only affects uninstall cleanup.RESIDUAL RISK
None
Description