Relationships
#4857 Source-run update can replace the Deno runtime
Opened by stack72 · 11/18/2026
Problem
When Swamp is run from source through Deno, the update destination is the Deno runtime rather than a standalone Swamp executable. If the runtime's directory is writable and an update is available, a normal update can replace Deno with the Swamp release binary, breaking other Deno-based tools. A read-only installation instead fails with a permission error.
Evidence
At upstream revision dcaf9157f785e486964394ee4b6db336b29319a3, the CLI selects the runtime path as the destination (update.ts); the service passes it to the installer (update_service.ts); the installer replaces the selected path (http_update_checker.ts). The development-build message is only returned after the installation attempt.
I reproduced the target selection offline against an earlier development checkout using a fake update checker and installer: with the runtime path supplied as the destination, the installer received that same runtime path. The permission check and installation were stubbed; no executable was modified and no release was downloaded. The current upstream path above was verified by source inspection, not by running its full updater.
Expected
Reject self-update when executing under the Deno interpreter, or require an explicit safe Swamp installation target; keep standalone compiled-binary updates working. A regression test should cover both modes. Update checks that do not install should remain available.
Automoved by swampadmin from https://github.com/swamp-club/swamp/issues/3845
Open
No activity in this phase yet.
Sign in to post a ripple.