Repository navigation
feat(update): enforce the min_supported floor in v1 - #130
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The manifest has always carried
min_supportedand nothing read it: parsed intoManifestand never consulted, and themin_supported_baselinefile baked intogreffer-updaterhas no reader incli/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
:latestupdater 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
is_downgrade(#129)below_floor(this)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.--checkreports it too.Also fixes a live crash
version_tuple(merged in #129) usedstr.isdigit()to decideint()was safe on manifest-supplied text. It isn't: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
/dataratchet, 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.Verification
app/__init__.py+pyproject.toml), since the node image isCOPY . /appand the updater isCOPY cli/ /src/, so publishing without a bump would re-point an existing tag at different bytes.🤖 Generated with Claude Code