Skip to content

fix(provider): stage an update only as the version it is signed as - #2117

Merged
jonathan308 merged 5 commits into
devfrom
fix/updater-signed-version-matches-release
Nov 14, 2026
Merged

jonathan308 merged 5 commits into
devfrom
fix/updater-signed-version-matches-release

Conversation

@jonathan308

@jonathan308 jonathan308 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A security scan (finding 252) reported that coordinator metadata can mislabel a signed downgrade. Confirmed on dev:

  • SelfUpdater.latestRelease takes the release version from the coordinator's JSON, and checkForUpdate judges no-downgrade eligibility by it.
  • Staging verified the bundle, binary and mlx.metallib hashes and the pinned code signature, but never compared that label with the version the app is signed as. The recovery record then carried the label (UpdateInstallLayout.recordForStagedBundle).
  • So whoever controls the release response (the coordinator, a release-registration credential, or its TLS) could offer an older, genuinely Darkbloom-signed build under a newer version, and providers would install it. A solo provider's watchdog rolls a mismatched candidate back after three failed starts, but the label can be refreshed each cycle; a cluster member's reconciliation rebases to the signed version and keeps the downgrade.

The attacker still needs control of the release response and can only choose among old signed builds, so the impact is bounded, but the check is cheap and closes it.

Change

After the deep code-signature check, staging reads the app's sealed CFBundleShortVersionString (UpdateRecoveryStore.signedVersion(ofApp:), now static) and refuses the bundle unless it equals the release's version exactly. It runs before verifyRuntimeCapabilities, so a mislabelled bundle never runs its runtime smoke, and before the staged tree hash that commit re-verifies. It applies under every policy that verifies signatures (production and the signed test fixture), and every install path (darkbloom update, auto-update, the cluster pair cycle, the watchdog) goes through this one staging function.

Release builds already set CFBundleShortVersionString to the registered VERSION, and CI asserts it (scripts/provider-signing-validation.py); the coordinator requires bare semver. So exact string equality is the contract; prerelease labels (-dev.branch.N, -staging.N) compare as signed.

Before

flowchart LR
  classDef bad fill:#fde2e1,stroke:#c0392b,color:#1b1b1b
  classDef ok fill:#e3f4e1,stroke:#2e7d32,color:#1b1b1b
  classDef io fill:#e6eefc,stroke:#2f5fb3,color:#1b1b1b
  C["/v1/releases/latest<br/>version: 99.0.0"]:::io --> E{"99.0.0 newer<br/>than installed?"}:::bad
  E -- yes --> D["download, bundle hash"]:::ok
  D --> S["code signature (pinned)"]:::ok
  S --> R["runtime smoke"]:::ok
  R --> I["install app signed as 0.10.11<br/>recorded as 99.0.0"]:::bad
Loading

After

flowchart LR
  classDef ok fill:#e3f4e1,stroke:#2e7d32,color:#1b1b1b
  classDef io fill:#e6eefc,stroke:#2f5fb3,color:#1b1b1b
  classDef stop fill:#fff4d6,stroke:#b7791f,color:#1b1b1b
  C["/v1/releases/latest<br/>version: 99.0.0"]:::io --> E{"newer?"}:::ok
  E -- yes --> D["download, bundle hash"]:::ok
  D --> S["code signature (pinned)"]:::ok
  S --> V{"sealed CFBundleShortVersionString<br/>== release version?"}:::ok
  V -- no --> X["refused before any staged code runs"]:::stop
  V -- yes --> R["runtime smoke"]:::ok
  R --> I["install"]:::ok
Loading

Validation

Check Result
New signedVersionMustMatchRelease on dev's staging code fails: an app signed as 0.10.11 stages as release 99.0.0
Same test with this change passes: refused with "is signed as version 0.10.11, not release 99.0.0"; an app signed 0.10.13-dev.branch.7 still stages as that release
SelfUpdaterTests (2 suites, incl. the real signed-fixture verification and fan-helper cases) 25/25 pass
Update, rollback, recovery, watchdog, auto-update and cluster-service-update suites 105 + 62 tests pass
make docs-check, make docs-impact-check BASE=upstream/dev, make changelog-check pass

Tests ran on an M3 Ultra with DARKBLOOM_RELEASE_ENVIRONMENT=prod, as CI builds them.

Limitations

  • scripts/install.sh (fresh installs) has no equivalent check; it has no no-downgrade rule to bypass and writes no update record, so a mismatch there only changes the version it prints.
  • An app that names no version is refused ("(none)"); no current release lacks it.

Security stack

This strengthens update verification; encryption, attestation and weight-hash code are untouched. Signature verification is unchanged and still runs first.

Refactor pass

An independent refactor pass found no correctness bug and no install path that skips the check or legitimately installs a different signed version. It moved the check ahead of the runtime smoke (so a mislabelled bundle runs no staged code) and tightened test and changelog wording (second commit).

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

jonathan308 and others added 2 commits November 13, 2026 15:28
`latestRelease` takes the release `version` from the coordinator's JSON, and
`checkForUpdate` judges no-downgrade eligibility by it. Staging verified the
bundle, binary and metallib hashes and the pinned code signature, but never
compared that label with the version the app is signed as, and the recovery
record then carried the label. Whoever controls the release response could
offer an older, genuinely signed build under a newer version and have it
installed.

After the deep signature check (and the runtime capability check), staging
now requires the app's sealed `CFBundleShortVersionString` to equal the
release's `version` exactly, under every policy that verifies signatures
(production and the signed test fixture). Release builds set that key to the
registered version, which the coordinator requires to be bare semver, so an
exact string comparison is the contract. `signedVersion(ofApp:)` becomes
static so staging can use the same reader as recovery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refactor-pass follow-up. Read the sealed version right after the deep
signature check, before `verifyRuntimeCapabilities` runs any staged code, so
a mislabelled release is refused without running its smoke test on every
Mac each update cycle. Accept and refuse are unchanged for every input; only
which error is reported changes when several checks fail. Test and changelog
wording now say exactly what they show.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference-landing Ready Ready Preview Nov 14, 2026 4:56am UTC
darkbloom-status Ready Ready Preview Nov 14, 2026 4:56am UTC
eigen-homepages-darkbloom Ready Ready Preview Nov 14, 2026 4:56am UTC

Request Review

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rsion-matches-release

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rsion-matches-release

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308 added a commit that referenced this pull request Nov 14, 2026
- changelog.d/gemma-tool-grammar-linear-optional-members.md: generic public text (#2111)
- changelog.d/updater-signed-version-matches-release.md: generic public text (#2117)
- changelog.d/cluster-pairing-posture-is-self-reported.md: generic public text (#2129)
- changelog.d/inbound-json-depth-and-tool-schema-budget.md: generic public text (#2130)
- changelog.d/coordinator-inbound-queue-budget.md: generic public text (#2135)
- changelog.d/toml-parse-memory.md: generic public text (#2138)
- changelog.d/cluster-link-key-keychain.md: generic public text (#2137)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jonathan308
jonathan308 merged commit 52384d0 into dev Nov 14, 2026
19 checks passed

This branch was successfully deployed

3 active deployments
Preview – d-inference-landing — 7c670315 Deployed Nov 14, 2026 by vercel[bot]
Preview – eigen-homepages-darkbloom — 7c670315 Deployed Nov 14, 2026 by vercel[bot]
Preview – darkbloom-status — 7c670315 Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant