Skip to content

fix(auth-eth): refuse legacy authorization once a later root epoch is current - #1545

Merged
kvinwang merged 1 commit into
feat/kms-epochs-combinedfrom
fix/legacy-auth-reject-rotated
Nov 9, 2026
Merged

kvinwang merged 1 commit into
feat/kms-epochs-combinedfrom
fix/legacy-auth-reject-rotated

Conversation

@kvinwang

@kvinwang kvinwang commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

isKmsAllowed and isAppAllowed now return (false, "Root epoch requires epoch-aware authorization") while the current root epoch is nonzero.

These legacy entry points serve pre-epoch KMS binaries, which only hold epoch 0. After rotation they still answered from row 0, which keeps the old KMS measurements and the OS images needed for disk migration, so they approved old KMS by default and the cutoff relied on the backend's rootEpochDenial only. The contract now enforces it on its own. Behavior before any rotation is unchanged.

Tests: forge test --ffi 100 passed; forge fmt --check clean.

… current

isKmsAllowed and isAppAllowed serve KMS binaries that predate root epochs and
only know epoch 0. After a rotation, epoch 0 is compromised by definition, yet
these entry points kept answering from row 0, where the old KMS measurements
and the OS images still needed for disk migration stay approved. The cutoff of
old KMS software therefore relied on the backend's rootEpochDenial alone.

Refuse both entry points while the current root epoch is nonzero, so the
contract enforces the cutoff on its own. Behavior before any rotation is
unchanged.

Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang merged commit e974ce1 into feat/kms-epochs-combined Nov 9, 2026
3 checks passed
@kvinwang
kvinwang deleted the fix/legacy-auth-reject-rotated branch November 9, 2026 15:12
kvinwang added a commit that referenced this pull request Nov 9, 2026
Since #1545, isKmsAllowed and isAppAllowed refuse while a later root epoch
is current. Replace the epoch-0 equivalence check, which setUp's rotated
state no longer reaches, with two checks: both entry points refuse after a
rotation, and before any rotation isKmsAllowed decides as kms_serve at
epoch 0 even with the next epoch registered and prepared.

Removing either rotation guard or reading the pending row each produce a
counterexample.

Signed-off-by: Kevin Wang <wy721@qq.com>
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