Skip to content

1bit-update --latest: 'newer' comes from the unsigned release tag (rollback/freeze); bind tag+channel into the signed SHA256SUMS #3448

Done

Description

@bong-water-water-bong

1bit-update --latest (#3444, merged) takes the decision "this release is newer" from the GitHub release's tag_name, through update_pick's newer=. That tag is not covered by the release signature. #3442/#3447 sign DOMAIN + SHA256SUMS bytes, and SHA256SUMS lists file digests only.

Consequence (rollback / freeze):

  • Someone who can publish or replace release assets but does not hold the release key can do two things: a compromised token with contents: write, or a tampered mirror if one is ever added.
    • Rollback: publish an older, validly signed SHA256SUMS + SHA256SUMS.sig + image under a newer tag. --latest sees newer=yes, the signature verifies, and the box installs the old image, including any vulnerability it carried, for example a kernel CVE that a later release fixed.
    • Freeze: keep re-serving the current release, so the box never learns about a newer one.
  • The key holder's guarantee today is "this image was signed by us at some point", not "this is the newest release we signed".

Where it is decided: os/v3/puppy/embed/usr/local/bin/1bit-update (main):

  • update_latest reads _v newer from update_pick's JSON parse of the API response;
  • ONEBIT_UPDATE_ANY skips that check entirely.

Suggested fix:

  1. Bind the release identity into the signed bytes. Add tag <tag> and channel <stable|test> lines to the signed message, either inside SHA256SUMS or as lines after the domain prefix. release_sign.py verify-image then returns the signed tag.
  2. Decide "newer" on the signed tag. --latest compares the signed tag against the running /etc/1bit/release-identity with update_pick's ordering, and refuses one that is not greater. An explicit --allow-downgrade can override, and it prints a warning. The unsigned tag_name is then only used to find the assets.
  3. Optional, for freeze: a signed "latest" pointer per channel with an expiry (TUF-style timestamp), so a box can tell "no newer release" from "I'm being shown a stale one". That's only worth it if the threat model calls for it.

Smaller and already mitigated, for the record: the image is verified (verify-image) and then re-read by zstd -d from the same path. The window is real, but /data/updates/<tag> is created by root (755), so only root can swap the file in between. It would reopen if ONEBIT_UPDATE_DIR pointed somewhere user-writable. Hashing during decompression, or refusing a non-root-owned UPDATE_DIR, would close that.

Found while reviewing #3442 / #3447 (lane cl-flm). Not exploited or tested on hardware: this is reading the code on main.

Activity

  1. bong-water-water-bong commented on Nov 24, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Update from lane cl-flm: the rollback half is fixed on main. 1bit-update (os/v3/puppy/embed/usr/local/bin/1bit-update, around lines 436-456) now reads the release identity from inside the verified image (etc/1bit/release-identity in its SFS, covered transitively by the signed SHA256SUMS). It refuses the install unless that tag equals the requested one and is strictly newer than the running release (update_ver_gt), so an old signed image re-published under a newer tag is refused. That's a better fix than signing the tag separately, because the identity is part of the signed bytes already.

    Still open, and lower priority: freeze. Someone who controls what the box is served can keep serving the current release and hide a newer one; --check then says "up to date". Closing that needs a signed, expiring "latest per channel" statement (a TUF-style timestamp). That's only worth it if the threat model includes a compromised release host. Leaving the issue open for the owner to decide whether that's in scope.

  2. bong-water-water-bong commented on Nov 24, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Delivered in two pieces, merged as #3474 (fa0c8777):

    1. Verification of what 1bit-update --latest: install only the release it asked for, newer than this one - read from the VERIFIED image (rollback protection, security) #3454 closed and what it leaves open. 1bit-update --latest: install only the release it asked for, newer than this one - read from the VERIFIED image (rollback protection, security) #3454 records the tag/channel/run it asked for and reads the tag from etc/1bit/release-identity inside the verified image's SFS before any slot write, refusing no-identity, mismatched, not-strictly-newer and rc-on-stable — so relabelled rollback is closed. But update_pick chooses from GitHub's unsigned release list and --latest exits "up to date" before any signature is checked, so a host that keeps serving the current release (compromised token, deleted/draft newer release, a mirror) freezes a machine at "up to date" forever. No signed, expiring "latest per channel" statement exists.
    2. Honest reporting now, plus the RFC draft (docs/update-trust.md): --check/--latest say when the running release is ahead of the channel's newest instead of a flat "up to date", and print that the answer is the unsigned list's word and what that cannot detect. Control: two new test arms fail on origin/main's updater and pass here; update_check + release_check_selftest green.

    Still open: the freeze/anti-replay decision, which is yours — the RFC recommends option A (a signed, expiring "latest per channel" pointer at a fixed URL, same release key, new domain prefix, sums_sha256 binding, refuse install when unprovable), with B (TUF), C (signed tag-commit binding), D (tag+channel into SHA256SUMS — cheap, does not stop freeze) and E (accept the risk and close) laid out. Open questions are in §"Open questions" of the doc — the first is simply is freeze in the threat model?

    I have not posted the RFC to Discussions; the draft is ready to paste when you want it, and the option-A implementation would follow acceptance.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions