Repository navigation
fix(auth): answer InvalidSignatureException for timestamps outside skew window (#805) - #889
Draft
Dodothereal wants to merge 1 commit into
Draft
Dodothereal wants to merge 1 commit into
Dodothereal wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
What changes
When a request has an
X-Amz-Datetimestamp outside the ±15 minute clock skew window, ExtendDB returnedUnrecognizedClientExceptionwith the generic message"Signature expired: the signature is too old or the request date is too far in the future.".Amazon DynamoDB returns
InvalidSignatureException(HTTP 400) with specific messages indicating the direction and boundary times compared against the server clock:Signature expired: <date> is now earlier than <edge> (<server_time> - 15 min.)Signature not yet current: <date> is still later than <edge> (<server_time> + 15 min.)This PR updates
validate_timestampincrates/auth/src/sigv4/verify.rsto returnInvalidSignatureExceptionwith the directional messages and addsformat_iso8601_basic.Measurements
As reported and measured by the issue reporter in #805 against Amazon DynamoDB in
us-east-1on 2026-11-03 (and referenced in PR #792):InvalidSignatureExceptionSignature expired: 20261103T201550Z is now earlier than 20261103T201650Z (20261103T203150Z - 15 min.)InvalidSignatureExceptionSignature not yet current: 20261103T204750Z is still later than 20261103T204650Z (20261103T203150Z + 15 min.)(Note: Live AWS measurements were not performed in this workspace; they are cited directly from the reporter's findings in #805).
Tests & Validation
crates/auth/src/sigv4/verify.rs:validate_timestamp_expired_returns_invalid_signature_exception: verifies exactSignature expirederror code and text format against known epoch.validate_timestamp_future_returns_invalid_signature_exception: verifies exactSignature not yet currenterror code and text format against known epoch.validate_timestamp_at_exact_boundaries_succeeds: verifies exact ±15 minute boundary timestamps are accepted.validate_timestamp_live_clock_succeeds_for_now: verifies current timestamps validate cleanly against system clock.cargo test -p extenddb-auth(441 unit tests, 3 doctests passed).cargo fmt --checkandcargo clippy -p extenddb-auth --all-targets -- -D warningspassed cleanly.CONTRIBUTING & RFC / Auth Policy Note
Under
CONTRIBUTING.md, an RFC is requested for changes to wire protocol or authentication/authorization. Meanwhile,docs/rfcs/README.mdnotes that an RFC is not required for bug fixes, dependency bumps, internal refactors that preserve public behavior, documentation, or tests.This PR does not alter ExtendDB's authentication model, the 15-minute window threshold, or the constant-time pipeline invariants. However, because it alters the returned error type and message for out-of-skew requests on the wire, this PR is submitted as a draft to seek maintainer review on whether this bug fix falls under standard bug fix treatment or requires an RFC or ADR.
Provenance & Disclosure
Checklist
cargo test -p extenddb-auth)cargo fmt --check)cargo clippy -p extenddb-auth --all-targets -- -D warnings)