Skip to content

Upgrade existing Sunshine installations to the security release - #11956

Closed
ErikMelton wants to merge 2 commits into
quattrofrom
fix/sunshine-security-upgrade
Closed

ErikMelton wants to merge 2 commits into
quattrofrom
fix/sunshine-security-upgrade

Conversation

@ErikMelton

@ErikMelton ErikMelton commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Upgrade existing Sunshine installations to 2026.914.233613 or newer to address GHSA-fp6g-27w5-489j, which allows untrusted GUI modules to load with Linux file capabilities.

The migration skips machines without Sunshine and installations already at a patched or newer version. Older versions are upgraded through pacman with a minimum-version constraint, and the installed version is verified afterward. A failed or ineffective upgrade leaves the migration pending.

Release prerequisite: build and publish omacom/omarchy-pkgs#458 before shipping this migration. That PR sets the default package version to 2026.914.233613-1.

Validation: bash test/shell.d/sunshine-upgrade-migration-test.sh passes for absent, vulnerable, patched, and newer versions; repeat execution; transaction failure; and an unchanged vulnerable version after an apparently successful upgrade. Bash syntax and whitespace checks pass. Tests use a stub package manager; no live package upgrade or streaming test was run.

Original report: Sean Huber.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@llstrk

llstrk commented Sep 28, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Verified: for the repository sunshine package, the migration does what the description says. Versions older than 2026.914.233613 take the upgrade branch; absent, patched and newer installs are skipped. A failed or ineffective upgrade exits non-zero, so omarchy-migrate leaves it pending. The advisory, the minimum version and the upstream tag match, and the PR's test passes on its own head. Three problems remain: the release prerequisite is out of date and no patched aarch64 build is published, AUR Sunshine variants under another name (sunshine-bin, sunshine-git) can never pass the migration, and the test fails once merged with current quattro.

Real pacman 7.1.0 and vercmp, synthetic local database Result
Sunshine absent, or 2026.914.233613-1 installed exit 0, no pacman -S call
vercmp against 2026.914.233613 2026.516.143833-4.1 and 2026.906.222525-1.2 lower; 2026.914.233613-1 equal; 2026.927.202034-1 higher
pacman -T 'sunshine>=2026.914.233613' exit 127 for 2026.516.143833-4.1, exit 0 for 2026.914.233613-1 (matches the test stub)

The stated prerequisite is out of date, and aarch64 has no patched build

omarchy-pkgs#458 was closed without merging ("Looks like we already got this one in a daily update"). The same version reached omarchy-pkgs master through the automatic upstream sync (pkgbuilds/sunshine/PKGBUILD, pkgver=2026.914.233613, arch=('x86_64' 'aarch64')), but it is only published for edge x86_64:

Published [omarchy] database, 2026-09-28 x86_64 aarch64
edge 2026.914.233613-1 2026.516.143833-4.1
rc 2026.516.143833-4.1 no Sunshine
stable 2026.516.143833-4.1 no Sunshine

Against the edge aarch64 database, pacman -S --needed --noconfirm 'sunshine>=2026.914.233613' prints error: target not found: sunshine>=2026.914.233613 and exits 1, and the migration exits 1 at that step. The edge aarch64 repository already carries an omarchy-dev build of the current quattro tip, so a merged migration reaches machines running omarchy-dev with its next build. Machines on the omarchy release package get it only with a later release.

omarchy update
  -> omarchy-update-system-pkgs (-Syu)   no newer Sunshine on edge aarch64
  -> omarchy-migrate
       -> 1789471023.sh: pacman -S 'sunshine>=2026.914.233613'
            error: target not found  -> exit 1
       -> later migrations skipped, marker not written
  -> update stops ("Something went wrong during the update!")

Impact: aarch64 Sunshine users on edge omarchy-dev would hit this failure on every omarchy update and every run from the pending-migrations notification until a patched aarch64 build is published. Orphan cleanup, service restarts and post-update hooks after omarchy-migrate are skipped as well. The same applies to a development checkout that tracks quattro while its pacman channel is stable or rc. For x86_64 rc and stable, the edge to rc to stable promotion described in the omarchy-pkgs README would carry the patched build along with the release; that part is inferred from the documented pipeline, not observed.

Suggested change: update the description, since #458 will not be merged. Then either wait until a patched aarch64 Sunshine is published, or let the migration finish without blocking when the configured repositories have no patched build. Because omarchy update runs -Syu before migrations, a non-blocking version does not lose the upgrade: the first -Syu after the build is published upgrades a repository Sunshine anyway, unless it is held in IgnorePkg.

AUR Sunshine variants under another name can never pass the migration

sunshine-bin and sunshine-git on the AUR declare provides=('sunshine') and conflicts=('sunshine') without a version. pacman's -Q falls back to providers, so with sunshine-bin 2026.914.233613-1 installed, pacman -Q -- sunshine prints sunshine-bin 2026.914.233613-1. The ${installed_version#sunshine } strip does not match that output, and vercmp 'sunshine-bin 2026.914.233613-1' 2026.914.233613 returns -1, so even a patched or newer AUR package takes the upgrade branch. Then:

  • pacman -S --needed --noconfirm 'sunshine>=…' picks the repository sunshine. --noconfirm answers the Remove sunshine-bin? [y/N] conflict question with No, and pacman exits 1 with unresolvable package conflicts detected. Where no patched build is published, the error is target not found instead.
  • Even if the transaction succeeded, pacman -T 'sunshine>=2026.914.233613' exits 127 for sunshine-bin, because an unversioned provides does not satisfy a versioned dependency.

Impact: a user with sunshine-bin or sunshine-git gets a migration that fails on every run and stops omarchy update, even when their Sunshine is already patched. The pacman conflict error does not explain why.

Suggested change: read the package name as well as the version, for example read -r name installed_version < <(pacman -Q sunshine). When name is not sunshine, print that Sunshine comes from $name and has to be updated from its own source, then exit 0 (or apply another deliberate policy). A test case with a provider package would cover it.

The test fails once merged with current quattro

Since #11495 ("Treat command operands as literal values"), bin/omarchy-pkg-present on quattro runs pacman -Q -- "$pkg". The test's pacman stub requires $2 == "sunshine" for -Q, so on the merge with the current tip omarchy-pkg-present sunshine returns false and the migration skips. The test prints ok - absent, patched, and newer Sunshine installations are unchanged (passing only because the presence check now fails, so the version check is not exercised) and then fails with not ok - vulnerable Sunshine is upgraded. Git reports no conflict, so this only shows up when the tests are run after merging. This is a test-only failure; the migration itself is unaffected by the --.

Suggested change: accept the separator in the stub. With this line added before case "$1" in, the test passes on the merge with the tip:

[[ ${2:-} != "--" ]] || set -- "$1" "${@:3}"

Notes for maintainers

  • A running Sunshine keeps the old code. The upstream fix sanitizes the environment and drops privileges once, at the start of main(). pacman replaces the binary, but nothing restarts a running process: the package's post_upgrade only reapplies setcap and reloads udev rules, the user unit only restarts on failure, and omarchy-update-restart has no Sunshine case. Omarchy can also start a second copy through the Hyprland autostart line that omarchy-install-service-sunshine adds. Every new start runs the patched binary, so the remaining exposure is a process that was already started with a malicious environment. This gap applies to every Sunshine update, and in the normal path -Syu upgrades Sunshine before this migration runs. A restart request or notice would therefore only be useful if it does not depend on this migration's upgrade branch, for example omarchy-state set reboot-required when Sunshine is installed, patched and running. This is based on source reading only; no running Sunshine was tested.
  • IgnorePkg = sunshine is overridden. -Syu respects the hold, but the migration's explicit pacman -S --noconfirm answers sunshine is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] with Yes. That may be intended for a security fix, and a line saying so in the migration's output would explain it.
  • Overlapping open PR: Sunshine: canonical unit enable and security-floor bump #12271 also adds a Sunshine security-floor migration (migrations/1789400200.sh) for the same 2026.914.233613-1 minimum, through a helper that installs the build from edge and skips AUR providers. Its migration sorts before this one, so on x86_64 this PR's migration would then find a patched version and skip. On aarch64, Sunshine: canonical unit enable and security-floor bump #12271's helper skips when no edge build exists, and this PR's migration still fails. If both merge, two migrations cover the same upgrade.

Review information

Test scope: source review of the PR against its merge base and the current quattro tip, plus omarchy-pkgs master and #458, the Sunshine advisory and v2026.914.233613 source, the AUR sunshine-bin/sunshine-git metadata and pacman v7.1.0 source. Isolated command-only runs used real pacman 7.1.0 and vercmp with synthetic local databases and the published [omarchy] sync databases as of 2026-09-28. -S runs used --print or a synthetic root that stopped before installing anything, with dependency checks skipped (-dd) because only the [omarchy] database was loaded. The conflict and IgnorePkg override results come from runs without --print. aarch64 behaviour was checked by pointing x86_64 pacman at the aarch64 database. No real package transaction, sudo, Sunshine process or aarch64 hardware was used, and the full ./test/shell suite was not run. Published package versions can change after this snapshot.

AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

sunshine-bin and sunshine-git provide and conflict with sunshine without a version, so pacman -Q sunshine names them, the version strip misses, and the migration tried to replace them with the repo package. --noconfirm declines the conflict and pacman exits 1, so the migration failed on every update even for an already patched provider. The notice is worded for a provider that may already be patched, since its version is not comparable to the repo package's.

The test's pacman stub now also accepts the -- that omarchy-pkg-present passes on quattro since #11495; without it the test failed once merged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed by Claude Opus 5.5, with Codex Medium as the second opinion. The migration works where a patched Sunshine is published, but where it is not, it would stop omarchy update. Whether and when it should ship is for the maintainer to decide.

What ran. Everything ran on a disposable Omarchy worker, using real pacman and a real Sunshine install:

  • With vulnerable sunshine 2026.516.143833-4.1 installed and the edge repository configured, the migration upgraded it to 2026.914.233613-1. Running it again did nothing.
  • On the stable repository, the same migration exits 1 with error: target not found: sunshine>=2026.914.233613.
  • test/shell.d/sunshine-upgrade-migration-test.sh and ./test/cli pass at the new head. The one ./test/cli failure on the merge with current quattro (vscode generated theme references current theme file) also fails on quattro alone.

Pushed to the branch (1de7d32).

  • sunshine-bin and sunshine-git provide and conflict with sunshine, so pacman -Q sunshine names them. The migration then tried to replace them with the repo package, --noconfirm declined the conflict, and the migration exited 1 on every update. That happened even with an already patched sunshine-bin 2026.914.233613-1, which was reproduced on the worker. The migration now tells the user to update such a provider from its own source and moves on. A new test case covers this, and it fails when the fix is reverted.
  • Since [Security] Treat command operands as literal values #11495, omarchy-pkg-present on quattro calls pacman -Q -- sunshine. The test's pacman stub did not accept the --, so once merged with quattro the test failed at vulnerable Sunshine is upgraded. The stub now accepts it.

Open, for the maintainer. Published [omarchy] databases checked today:

Channel x86_64 aarch64
edge 2026.914.233613-1 2026.516.143833-4.1
rc 2026.516.143833-4.1 none
stable 2026.516.143833-4.1 none

omarchy update runs -Syu before omarchy-migrate. Where the patched build is published, -Syu has already upgraded Sunshine and this migration does nothing. Where the build is missing, the migration fails, stays pending, and blocks every later migration and the rest of the update until a patched build reaches that channel. Today that already hits edge aarch64 machines with omarchy-dev, and it would hit rc and stable if the migration shipped before the package. So the migration is a version gate, and the real fix is publishing the package. Codex reached the same conclusion; that is agreement, and its independence is not guaranteed. The release prerequisite in the description is also out of date: omarchy-pkgs#458 was closed, and the version arrived through the upstream sync instead.

#12271 competes: it installs the edge build directly with pacman -U across channels, skips aarch64 as done without patching it, and bundles unrelated service changes. Asked separately which approach is better, Codex preferred this one's narrower approach through the configured repository, but would not merge either before the package is published everywhere.

Waiting on the maintainer to decide whether a gating migration is wanted once the patched Sunshine is published on every channel and architecture, or whether publishing the package is enough on its own.

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 3/5

[Critical risk] Deploys a system-level security patch migration.

The PR should not merge while a vulnerable alternate Sunshine installation can be marked as migrated without being patched.

Findings

  1. P1 Security Vulnerable variant marked complete ▶

Summary

Adds a migration to upgrade older repo-installed Sunshine packages to the security release and tests its skip, upgrade, and failure paths.

  • A vulnerable alternate Sunshine package can be left in place while the migration is marked complete.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Migration starts] --> B{Sunshine detected?}
  B -- No --> Z[Complete]
  B -- Yes --> C{Package named sunshine?}
  C -- No --> D[Print update instruction]
  D --> Z
  C -- Yes --> E{Below minimum version?}
  E -- No --> Z
  E -- Yes --> F[Upgrade and verify]
  F -- Success --> Z
  F -- Failure --> G[Remain pending]
Loading

Reviews (1) · Last reviewed commit: "Leave AUR Sunshine providers to their ow..."

Comment thread migrations/1789471023.sh
Comment on lines +9 to +10
if [[ $installed_package != "sunshine" ]]; then
echo "Sunshine comes from $installed_package; update it from its own source if it is older than $minimum_version"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security Vulnerable variant marked complete

When an older Sunshine variant such as sunshine-bin is installed, this branch only prints an update instruction. The migration then exits successfully, so omarchy-migrate marks it complete even though the vulnerable installation remains unchanged and will not be retried.

How this was verified: The alternate-package branch performs no version check or upgrade, and the migration runner writes its completion marker after a successful exit.

@omarchybot

Copy link
Copy Markdown
Collaborator

Greptile's point on migrations/1789471023.sh:10 is right about what happens: with sunshine-bin or sunshine-git installed, the migration prints a notice and exits 0, so it is marked done whether that package is patched or not. Making that case fail would be worse, though. The migration cannot upgrade an AUR package. On quattro, omarchy-update runs omarchy-migrate (line 129) before omarchy-update-aur-pkgs (line 148), so a failing migration would block the AUR update that actually patches sunshine-bin. It would also block every later migration, and it would do the same for providers that are already patched. Codex Medium raised the AUR ordering when asked about this comment. I confirmed it in the source. It found no other defect at 1de7d32.

So this is a scope choice for the maintainer, not a defect to push a fix for: this migration covers the repo package and leaves AUR providers to their own updates. Nothing else has changed since my last comment, and the PR still waits on the maintainer's decision about shipping a migration that fails wherever the patched package is not yet published.

@jandrusk

Copy link
Copy Markdown

Thanks for flagging the advisory. It looks like the patched build has already shipped: pkgbuilds/sunshine in omarchy-pkgs is at 2026.914.233613-1 (Ryan noted on omarchy-pkgs#458 that it landed via the daily update), and omarchy update runs pacman -Syu, which picks it up without a migration. Unless there's a case I'm missing where that doesn't happen, this could probably be closed.

@omarchybot

Copy link
Copy Markdown
Collaborator

Checked again after @jandrusk's comment, by Claude Opus 5.5 with Codex Medium as the second opinion. The head has not moved since 1de7d32, so nothing was re-run; what changed is where the patched package is published.

Published [omarchy] databases, read today on a disposable worker:

Channel x86_64 aarch64
edge 2026.914.233613-1 2026.914.233613-1
rc 2026.516.143833-4.1 none
stable 2026.516.143833-4.1 none

Edge aarch64 now has the patched build, so the case that made this migration stop omarchy update on edge omarchy-dev machines is gone.

On closing it. The comment is right for edge: omarchy-update runs omarchy-update-system-pkgs (-Syu) before omarchy-migrate, so where the patched build is published Sunshine is already upgraded when this migration runs, and it does nothing. It is not yet right for rc and stable, where x86_64 still serves the vulnerable 2026.516.143833-4.1 and no release has been tagged since v4.0.4. There -Syu cannot fetch a build that is not published, and this migration would fail and hold back every later migration until it is. Either way the fix that reaches users is promoting the package; the migration adds only that an IgnorePkg hold on sunshine is overridden, and a gate that fails while the package is missing. Codex reached the same reading from the source and found no new defect at this head; that is agreement, and its independence is not guaranteed.

Whether to close this or keep it as a gate for the next release is for the maintainer to decide, together with the competing #12271.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants