Skip to content

feat(update): enforce the min_supported floor in v1 - #130

Merged
omarsy merged 2 commits into
mainfrom
feat/enforce-min-supported-floor
Aug 8, 2026
Merged

omarsy merged 2 commits into
mainfrom
feat/enforce-min-supported-floor

Conversation

@omarsy

@omarsy omarsy commented Aug 8, 2026

Copy link
Copy Markdown
Member

The manifest has always carried min_supported and nothing read it: parsed into Manifest and never consulted, and the min_supported_baseline file baked into greffer-updater has no reader in cli/ at all.

Per the trust model the floor exists to "block below-floor reintroduction" — an update must never land the node on a release withdrawn as known-bad. v1 was meant to have it; hld-v2-per-container-recreate §7 says v1 "reads the manifest over HTTPS for the downgrade floor". It never did.

v2 is deliberately untouched

The :latest updater drops the floor by construction (§11), replacing it with verify-then-pull plus a pre-run no-downgrade refusal. Adding it there would reverse a recorded architectural decision, so this is v1-only.

Semantics, and why it isn't a duplicate of #129

about example
is_downgrade (#129) direction vs what is running 0.9 → 0.8
below_floor (this) absolute bound fresh install of 0.2.0

0.9 → 0.8 is a downgrade that may still be above the floor. A fresh install of a below-floor version is not a downgrade at all, yet is still refused.

Not overridable by --to. A downgrade is a legitimate operator choice; a below-floor release is withdrawn, so an explicit request for one is exactly what this refuses. --check reports it too.

Also fixes a live crash

version_tuple (merged in #129) used str.isdigit() to decide int() was safe on manifest-supplied text. It isn't:

"²".isdigit()        -> True     int("²")        -> ValueError
("9"*5000).isdigit() -> True     int("9"*5000)   -> ValueError (4300-digit limit)

Either turned a malformed manifest into a traceback out of greffer update / --check. Now requires plain ASCII digits with a bounded length. Found by Codex.

Honest scope, stated in the code

  • v1 fetches the manifest over HTTPS but does not verify its signature, and there is no /data ratchet, so a hostile or rolled-back origin can serve a lower floor. This is a safety guard against landing on a known-bad release, not a security control against a hostile origin. The signed-manifest + ratchet half (§11) remains unbuilt.
  • The floor is checked against the requested tag, not the version of the bytes that run. A tag moved or mispublished to below-floor content passes. Closing that needs the pulled image's version label, which v1 has no machinery to read — and that label is forgeable (v2 trust model §7), so it would not close the case against a hostile registry either. v1 does not cosign-verify images at all and is operator-trust by design, so tag-trust is already its baseline. Raised by Codex; documented rather than implemented, so no reader assumes the floor is content-based.

Verification

  • 294 tests pass (21 added).
  • The floor tests were verified to fail with the enforcement removed; the hostile-input tests to fail with the hardening removed (6 failures). Both pass with them restored, so they test the fix rather than the happy path.
  • Version bumped 0.10.0 → 0.11.0 (app/__init__.py + pyproject.toml), since the node image is COPY . /app and the updater is COPY cli/ /src/, so publishing without a bump would re-point an existing tag at different bytes.

🤖 Generated with Claude Code

omarsy added 2 commits August 8, 2026 14:22
The manifest has always carried min_supported and nothing read it: it was
parsed into Manifest and never consulted, and the min_supported_baseline
file baked into greffer-updater has no reader in cli/ at all.

Per the trust model the floor exists to "block below-floor reintroduction"
-- an update must never land the node on a release withdrawn as known-bad.
v1 was meant to have it: hld-v2-per-container-recreate section 7 says v1
"reads the manifest over HTTPS for the downgrade floor". It never did.

v2 is deliberately untouched. The :latest updater drops the floor BY
CONSTRUCTION (section 11), replacing it with verify-then-pull plus a
pre-run no-downgrade refusal. Adding it there would reverse a recorded
architectural decision, so this is v1-only.

Semantics, distinct from the downgrade guard added in #129: is_downgrade
is about DIRECTION relative to what is running; below_floor is about an
absolute bound. 0.9 -> 0.8 is a downgrade that may still be above the
floor, and a fresh install of a below-floor version is not a downgrade at
all yet is still refused.

NOT overridable by --to. A downgrade is a legitimate operator choice; a
below-floor release is withdrawn, so an explicit request for one is
exactly what this refuses. --check reports it too.

Also fixes a live crash in version_tuple, which #129 already merged.
str.isdigit() is not enough to make int() safe on manifest-supplied text:
it is True for non-ASCII digits ('²'.isdigit() is True, int('²') raises)
and for digit runs past CPython's 4300-char int-string limit. Either
turned a malformed manifest into a traceback out of `greffer update`.
Now requires plain ASCII digits with a bounded length. Found by Codex.

Honest scope: v1 fetches the manifest over HTTPS but does not verify its
signature, and there is no /data ratchet, so a hostile or rolled-back
origin can serve a LOWER floor. This is a safety guard against landing on
a known-bad release, not a security control against a hostile origin. The
signed-manifest + ratchet half (HLD section 11) remains unbuilt and is
stated as such in the docstring.

294 tests pass (21 added). Both the floor tests and the hostile-input
tests were verified to FAIL with their fix removed.
Codex flagged that below_floor() compares the requested tag, so a tag
moved or mispublished to below-floor content passes.

Correct, and left unimplemented on purpose. Closing it needs the pulled
image's version label, which v1 has no machinery to read, and that label
is forgeable (v2 trust model section 7) so it would not close the case
against a hostile registry either. v1 does not cosign-verify images at all
and is operator-trust by design, so tag-trust is already its baseline.

Documenting rather than silently leaving the reader to assume the floor is
content-based.
@omarsy
omarsy merged commit 8ea64fd into main Aug 8, 2026
7 checks passed
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