Skip to content

Watch must not trust unauthenticated footer body_len - #16

Open
paulocsanz wants to merge 2 commits into
beyondoss:mainfrom
paulocsanz:dst/b33-footer-body-len
Open

Watch must not trust unauthenticated footer body_len#16
paulocsanz wants to merge 2 commits into
beyondoss:mainfrom
paulocsanz:dst/b33-footer-body-len

Conversation

@paulocsanz

Copy link
Copy Markdown
Contributor

Footer trailer layout is [body][body_len][crc(body)][magic]. CRC does not cover body_len. read_footer checks range + CRC. data_end_offset (the scan_since bound) only looked at magic and subtracted body_len.

Flip body_len to records_enddata_end_offset = 0 → watch catch-up is empty while GET still serves every key.

Two commits: failing production test, then data_end_offset reuses read_footer. Corrupt length/CRC → scan to EOF.

  • body_len no longer blinds watch
  • Valid footer still stops before the trailer

body_len sits outside the CRC. scan_since trusted it, so
body_len=records_end made data_end_offset return 0.
body_len sits outside the CRC. scan_since used it raw, so a flip
to records_end collapsed the watch window to 0. Reuse read_footer's
range+CRC check; on any miss scan to EOF.
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