Skip to content

Fix four findings in registry verification with root keys - #283

Closed
ericmj wants to merge 2 commits into
mainfrom
signing-review-fixes
Closed

ericmj wants to merge 2 commits into
mainfrom
signing-review-fixes

Conversation

@ericmj

@ericmj ericmj commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Four changes to the registry verification with root keys, none of it released yet.

  • update_key_lists/3 treated stored key lists below min_version as absent, so revoked was always false for them. A Hex user who upgrades to a release that raises min_version after an intermediate key was revoked kept the registry files cached under that key. The keys of those stored lists now count for revoked. The lists still don't count for the rollback checks.
  • update_key_lists/3 compared versions before it checked the root signatures of the fetched intermediate key list. Anyone who can change a response could make a client report key_list_rollback or key_list_conflict with a list that nobody signed. Such a list now returns untrusted_key_list.
  • check_freshness/4 accepted any expiry below 2^63, so one freshness signature with a far expiry kept its payload accepted until the freshness key was revoked. An entry that expires more than 60 days from now doesn't count. 60 days is the longest a signing key list, which names the freshness keys, can be valid.
  • hex_repo removed a server-sent x-hex-payload-hash header from a 200 only. A caller that reads the header from a 304 got the server's value. It's now removed from every response.

update_key_lists/3 treated stored lists below `min_version` as absent, so
`revoked` was always `false` for them. A client release that raises
`min_version` after an intermediate key is revoked then kept the registry
files cached under that key.

The keys of those stored lists now count for `revoked`. The lists still
don't count for the rollback checks.
…the payload hash header

update_key_lists/3 checks that the root keys signed the fetched
intermediate key list before it compares versions, so a list that nobody
signed returns `untrusted_key_list` instead of `key_list_rollback` or
`key_list_conflict`.

A freshness entry that expires more than 60 days from now doesn't count.
That is the longest a signing key list, which names the freshness keys,
can be valid.

hex_repo removes a `x-hex-payload-hash` header that the repository sends
from every response, not only from a `200`.
@ericmj ericmj changed the title Report revoked keys of stored lists below min_version Fix four findings in registry verification with root keys Dec 3, 2026
@ericmj ericmj closed this Dec 3, 2026
@ericmj
ericmj deleted the signing-review-fixes branch December 3, 2026 23:59
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