decode_cursor length check accepts an over-long cursor instead of refusing it as malformed #91
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The independent review of the pagination work for PR 83 identified that the cursor decoder checks only a minimum size. The externally visible refusal is already cursor_expired, but the length predicate does not enforce the exact fixed-size encoding it is intended to validate.
In src/api/pagination.rs, decode_cursor checks whether the decoded bytes are shorter than PAYLOAD_BYTES plus the 32-byte HMAC tag. An otherwise valid cursor with trailing bytes therefore proceeds to HMAC verification instead of being rejected as malformed input.
What to change
Acceptance criteria
Blocked by
None. The check was introduced with the paginated read work in PR 83.