mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5646] Dev and e2e server instances can rewrite the developer's working repo via the loopback channel-switch update bypass #3123
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#3123
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Aug 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5646
Originally assigned to: @kolacheee on GitHub.
What happens
The update-apply route allows a full git update — stash local changes, checkout the channel branch,
pnpm install --force, rebuild — when the request is a loopback channel switch, even withUPDATES_APPLY_ENABLEDunset (packages/server/src/routes/updates.routes.ts~980:localChannelSwitchRequestedbypasses theisUpdatesApplyEnabled()gate). That is reasonable for a real install, but the Playwright e2e servers and plainpnpm devboot the same server from the developer's working repo — so any loopback browser tab pointed at a dev instance can rewrite the developer's checkout with one click of the channel selector.This actually happened today: while e2e servers were running from the working repo (branch
fix/5641-guarded-cache-writers, uncommitted changes present), a local tab's staging channel-switch applied a real update —auto-stash before updatein the stash list, HEAD moved tostaging, and a forced install/rebuild churned underneath two running Playwright sessions, wedging their boots. The stash preserved the uncommitted work (git did its job), but the repo silently changed branches mid-development and the e2e runs died in ways that looked like infrastructure flakiness.Try it yourself
Run
pnpm dev(or the Playwright suite, which boots the same dev servers) from a branch with uncommitted changes, open the app in a browser at its localhost port, and switch the update channel to staging in Settings. Watchgit status/git stash listin the repo afterward.Suggested direction
The e2e server launcher (
e2e/start-servers.mjs) and dev launcher (scripts/dev.mjs) should set an env the apply route treats as a hard refusal — e.g.UPDATES_APPLY_DISABLED=true(checked before both the enabled flag and the channel-switch bypass), the same way the e2e env already setsMARINARA_E2E_DISABLE_RATE_LIMIT. A dev-instance apply attempt should get the manual-command message instead of mutating the repo. Detecting "working tree has uncommitted changes / non-channel branch checked out" and refusing the apply with a clear message would also protect contributors who run dev servers by other means.Related: #5645 (the manual-command message those refusals fall back to has its own Windows-shell problems).
Found while investigating why local e2e runs kept wedging (2026-08-29).