Repository navigation
Re-attest on any backward wall-clock step (RD-4) - #50
Merged
Merged
Conversation
SignedMirror reused a cached role attestation while now - cached_ms was below the refresh interval, which a backward wall step makes negative: the old result was then reused indefinitely, and its attested_ms lay in the new clock's future, so readers on that clock honored a revoked subject for attest_ttl_ms plus the step. The cache is now valid only while young on both the wall clock (0 <= delta < refresh) and the monotonic clock. BoundedReader also refuses a head whose attestation postdates the head or the reader's clock (attestation_clock_regressed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0194kAmY4QqQGabdoB3xGFsr
This was referenced Nov 11, 2026
dbccpage
marked this pull request as ready for review
November 11, 2026 10:07
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.
Requested by Jeremy · project thread
What
SignedMirror._subjectsreused a cached role attestation whilenow - cached_ms < attest_ttl_ms // 3. A backward wall-clock step makes that negative, so the old result was reused indefinitely and itsattested_mssat in the new clock's future. Readers on that clock then honored a revoked subject forattest_ttl_msplus the step.0 <= wall_delta < refreshand0 <= monotonic_delta < refresh(time.monotonic_ns, injectable for tests).BoundedReader.readrefuses a head whoseattested_ms > issued_msor> nowasattestation_clock_regressed. (attest_expires_msalready boundsnow - attested_ms < attest_ttl_ms.)Evidence
New tests in
tests/test_clock_boundaries.py:test_backward_wall_step_forces_reattestation: shared host clock steps back 20 s after a REVOKE. On main the cached attestation is reused (calls == [1]) and the revoked subject still hits; here it re-attests and misses withauthorization_not_attested.test_monotonic_age_forces_reattestation_when_the_wall_clock_stallstest_reader_refuses_an_attestation_newer_than_its_headblack,mypyclean; heads + clock-boundary tests: 54 passed.Note: the new reader check is skew-sensitive the same way the existing
observed_mscheck is (a reader host behind the signer by more thanissued_ms - attested_msmisses).Generated by Claude Code