updates (#1562-9): a validly signed OLD release is accepted as new — the channel has no replay/downgrade protection #1579

Closed
opened 2026-09-18 14:24:30 +00:00 by ben · 2 comments
Owner

Parent: #1562 — contract: ADR 0248, ADR 0017

Found while ticketing the publish rail (2026-09-18).

The defect: a validly signed OLD release is accepted as a new one

Orchestrator.Poll (internal/update/update.go) records whatever the channel's feed names as long as its revision is not the one running and is not already tracked:

if rel.Revision == o.store.current.Revision || o.store.knows(rel.Revision) { return … }

Revisions are git shas — they carry no order — and the manifest's Published time is explicitly advisory and never checked (internal/matouchannel). So a feed Matou signed last month still verifies today. Anyone who can influence what a gateway fetches from the feed URL — a compromised or misconfigured serving host, a stale cache, a restored backup of the artifacts dir — can serve it, and every community that never ran that release (any community founded after it; knows only covers a fleet's own history) treats it as new, and under auto-security rolls it out unattended. That is a downgrade to software with known holes, carrying a valid Matou signature. The signature proves who cut a release, not that it is the latest.

What to build

  • Make release order signed and mandatory: a monotonically increasing sequence in the manifest (or published promoted from advisory to required and compared) — inside the signed bytes, so it cannot be edited.
  • The fleet records the highest sequence it has accepted per channel, durably, and refuses a release that is not strictly newer — as DDR 0250's refused, with its own check named in the operator's words (older than the release this community already has). It is a refused release LIST in the DDR's sense: nothing from it is applied.
  • A newly founded community starts from the sequence of the release it was founded from (the payload knows its own revision), so it cannot be walked backwards from day one.
  • Changing channel (testing ↔ stable) keeps a per-channel high-water mark; pin-or-fork is unaffected — a pinned fleet polls nothing.
  • The app-side reader (app/src/lib/matouChannel.ts) already refuses anything not strictly newer than currentVersion; keep ONE manifest format — add the field for both readers, not a fork.
  • The cutter (cmd/release-cut) and the publish rail emit the sequence; the rail refuses to publish a sequence that does not advance.

Acceptance (seam)

  • Given a fleet on release 7, When the feed serves validly signed release 5, Then nothing is tracked or rolled out and the surface carries a refusal naming the check
  • Given a community founded from release 7 with empty history, Then release 5 is refused exactly the same way
  • Given a manifest with no sequence, Then it is refused (mandatory, not best-effort)
  • Given the sequence edited outside the signature, Then signature verification fails first
  • Given release 8, Then it is accepted and the high-water mark persists across a control-plane restart
  • Full Go gate + the app's channel tests green; STATUS.md in the same commit
## Parent: #1562 — contract: ADR 0248, ADR 0017 Found while ticketing the publish rail (2026-09-18). ## The defect: a validly signed OLD release is accepted as a new one `Orchestrator.Poll` (`internal/update/update.go`) records whatever the channel's feed names as long as its revision is not the one running and is not already tracked: ```go if rel.Revision == o.store.current.Revision || o.store.knows(rel.Revision) { return … } ``` Revisions are git shas — they carry no order — and the manifest's `Published` time is explicitly *advisory* and never checked (`internal/matouchannel`). So a feed Matou signed last month still verifies today. Anyone who can influence what a gateway fetches from the feed URL — a compromised or misconfigured serving host, a stale cache, a restored backup of the artifacts dir — can serve it, and every community that never ran that release (any community founded after it; `knows` only covers a fleet's own history) treats it as **new**, and under auto-security rolls it out unattended. That is a downgrade to software with known holes, carrying a valid Matou signature. The signature proves who cut a release, not that it is the latest. ## What to build - Make release order **signed and mandatory**: a monotonically increasing sequence in the manifest (or `published` promoted from advisory to required and compared) — inside the signed bytes, so it cannot be edited. - The fleet records the highest sequence it has accepted per channel, durably, and **refuses** a release that is not strictly newer — as DDR 0250's *refused*, with its own check named in the operator's words (*older than the release this community already has*). It is a refused release LIST in the DDR's sense: nothing from it is applied. - A newly founded community starts from the sequence of the release it was founded from (the payload knows its own revision), so it cannot be walked backwards from day one. - Changing channel (`testing` ↔ `stable`) keeps a per-channel high-water mark; pin-or-fork is unaffected — a pinned fleet polls nothing. - The app-side reader (`app/src/lib/matouChannel.ts`) already refuses anything not strictly newer than `currentVersion`; keep ONE manifest format — add the field for both readers, not a fork. - The cutter (`cmd/release-cut`) and the publish rail emit the sequence; the rail refuses to publish a sequence that does not advance. ## Acceptance (seam) - [ ] Given a fleet on release 7, When the feed serves validly signed release 5, Then nothing is tracked or rolled out and the surface carries a refusal naming the check - [ ] Given a community founded from release 7 with empty history, Then release 5 is refused exactly the same way - [ ] Given a manifest with no sequence, Then it is refused (mandatory, not best-effort) - [ ] Given the sequence edited outside the signature, Then signature verification fails first - [ ] Given release 8, Then it is accepted and the high-water mark persists across a control-plane restart - [ ] Full Go gate + the app's channel tests green; STATUS.md in the same commit

swarm-claim host=bens-mac-04 run=26614
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=26614 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1579 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1579,
  "status": "success",
  "commits": [
    "e94c872f3f539b43d121ec4b33cfa67c952dfe16"
  ],
  "changed_files": [
    "STATUS.md",
    "app/src/lib/matouChannel.ts",
    "app/tests/unit/matouChannel.test.ts",
    "cmd/release-cut/main.go",
    "dashboard/src/lib/api/generated.ts",
    "internal/matouchannel/matouchannel.go",
    "internal/matouchannel/matouchannel_test.go",
    "internal/matourelease/matourelease.go",
    "internal/matourelease/matourelease_test.go",
    "internal/matourelease/publish.go",
    "internal/update/downgrade_test.go",
    "internal/update/export_test.go",
    "internal/update/refusal.go",
    "internal/update/store.go",
    "internal/update/update.go",
    "packages/openapi-spec/openapi.yaml"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/update/... ./internal/matouchannel/... ./internal/matourelease/... ./cmd/release-cut/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go build ./... && go vet (touched pkgs)",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run (touched pkgs)",
      "exit_code": 0
    },
    {
      "command": "npx vitest run tests/unit/matouChannel.test.ts (app)",
      "exit_code": 0
    },
    {
      "command": "node packages/openapi-spec/scripts/generate-client.mjs --check",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Given a fleet on release 7, When the feed serves validly signed release 5, Then nothing is tracked or rolled out and the surface carries a refusal naming the check": "internal/update/downgrade_test.go TestPoll_RefusesADowngradeOnAFleetWithHistory — Poll refuses seq 5 against high-water 7, sets ChannelRefused.Check=older-than-current, nothing on Pending/Automatic (internal/update/update.go highWaterFor + noteChannelStale)",
    "Given a community founded from release 7 with empty history, Then release 5 is refused exactly the same way": "TestPoll_RefusesADowngradeOnAFreshlyFoundedCommunity — high-water seeded from Current.Sequence via Store.highWaterFor, empty active/history, seq 5 refused older-than-current",
    "Given a manifest with no sequence, Then it is refused (mandatory, not best-effort)": "internal/matouchannel/matouchannel_test.go TestLatest_NoSequenceRefusesLoud — Latest refuses m.Sequence<1 as a FeedRefusedError (matouchannel.go); Cut also refuses (TestCut_NoSequenceRefuses)",
    "Given the sequence edited outside the signature, Then signature verification fails first": "TestLatest_SequenceEditedOutsideSignatureFailsSignatureFirst — editing the manifest's sequence breaks the detached Ed25519 signature; refusal is the signature check, not a sequence parse",
    "Given release 8, Then it is accepted and the high-water mark persists across a control-plane restart": "TestPoll_AcceptsStrictlyNewerAndHighWaterSurvivesRestart — seq 8 accepted, HighWaterForTest=8, OpenStore over the same MemoryBackend resumes 8, a post-restart seq 5 still refused from the durable mark (store.go HighWater in StoreDoc)",
    "Full Go gate + the app's channel tests green; STATUS.md in the same commit": "go build/vet/gofmt + full go test ./... + golangci-lint (touched pkgs) + app matouChannel vitest + check:client all exit 0; STATUS.md updated in e94c872f"
  },
  "summary": "The signed Matou channel now refuses a validly signed OLD release: a mandatory signed per-channel sequence, a durable per-channel high-water mark the fleet refuses below, and a publish rail that refuses a non-advancing cut.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1579 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1579, "status": "success", "commits": [ "e94c872f3f539b43d121ec4b33cfa67c952dfe16" ], "changed_files": [ "STATUS.md", "app/src/lib/matouChannel.ts", "app/tests/unit/matouChannel.test.ts", "cmd/release-cut/main.go", "dashboard/src/lib/api/generated.ts", "internal/matouchannel/matouchannel.go", "internal/matouchannel/matouchannel_test.go", "internal/matourelease/matourelease.go", "internal/matourelease/matourelease_test.go", "internal/matourelease/publish.go", "internal/update/downgrade_test.go", "internal/update/export_test.go", "internal/update/refusal.go", "internal/update/store.go", "internal/update/update.go", "packages/openapi-spec/openapi.yaml" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/update/... ./internal/matouchannel/... ./internal/matourelease/... ./cmd/release-cut/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go build ./... && go vet (touched pkgs)", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run (touched pkgs)", "exit_code": 0 }, { "command": "npx vitest run tests/unit/matouChannel.test.ts (app)", "exit_code": 0 }, { "command": "node packages/openapi-spec/scripts/generate-client.mjs --check", "exit_code": 0 } ], "criteria": { "Given a fleet on release 7, When the feed serves validly signed release 5, Then nothing is tracked or rolled out and the surface carries a refusal naming the check": "internal/update/downgrade_test.go TestPoll_RefusesADowngradeOnAFleetWithHistory — Poll refuses seq 5 against high-water 7, sets ChannelRefused.Check=older-than-current, nothing on Pending/Automatic (internal/update/update.go highWaterFor + noteChannelStale)", "Given a community founded from release 7 with empty history, Then release 5 is refused exactly the same way": "TestPoll_RefusesADowngradeOnAFreshlyFoundedCommunity — high-water seeded from Current.Sequence via Store.highWaterFor, empty active/history, seq 5 refused older-than-current", "Given a manifest with no sequence, Then it is refused (mandatory, not best-effort)": "internal/matouchannel/matouchannel_test.go TestLatest_NoSequenceRefusesLoud — Latest refuses m.Sequence<1 as a FeedRefusedError (matouchannel.go); Cut also refuses (TestCut_NoSequenceRefuses)", "Given the sequence edited outside the signature, Then signature verification fails first": "TestLatest_SequenceEditedOutsideSignatureFailsSignatureFirst — editing the manifest's sequence breaks the detached Ed25519 signature; refusal is the signature check, not a sequence parse", "Given release 8, Then it is accepted and the high-water mark persists across a control-plane restart": "TestPoll_AcceptsStrictlyNewerAndHighWaterSurvivesRestart — seq 8 accepted, HighWaterForTest=8, OpenStore over the same MemoryBackend resumes 8, a post-restart seq 5 still refused from the durable mark (store.go HighWater in StoreDoc)", "Full Go gate + the app's channel tests green; STATUS.md in the same commit": "go build/vet/gofmt + full go test ./... + golangci-lint (touched pkgs) + app matouChannel vitest + check:client all exit 0; STATUS.md updated in e94c872f" }, "summary": "The signed Matou channel now refuses a validly signed OLD release: a mandatory signed per-channel sequence, a durable per-channel high-water mark the fleet refuses below, and a publish rail that refuses a non-advancing cut.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1579
No description provided.