Skip to content

fix(arrow/ipc): validate file block framing and lengths - #1097

Merged
zeroshade merged 4 commits into
apache:mainfrom
fallintoplace:fix/ipc-file-block-framing
Aug 10, 2026
Merged

fix(arrow/ipc): validate file block framing and lengths#1097
zeroshade merged 4 commits into
apache:mainfrom
fallintoplace:fix/ipc-file-block-framing

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

IPC file footers contain metadata and body lengths, while each message also carries framing information. File readers currently check that footer ranges are readable but can accept messages whose framing and footer lengths disagree.

What changes are included in this PR?

Validate continuation and legacy metadata prefixes against the footer, reject EOS markers inside file blocks, compare Message.BodyLen with the footer body length, and reject body lengths that are not 8-byte aligned. Share the checks between regular and memory-mapped file readers.

Are these changes tested?

  • go test ./arrow/ipc -count=1
  • Added coverage for valid modern and legacy messages, both readers, metadata mismatches, body mismatches, EOS markers, and unaligned bodies.

Are there any user-facing changes?

Yes. Invalid IPC file framing and inconsistent footer lengths are now rejected by both file readers.

@fallintoplace fallintoplace changed the title fix(ipc): validate file block message lengths fix(ipc): validate file block framing lengths Aug 5, 2026
@fallintoplace
fallintoplace force-pushed the fix/ipc-file-block-framing branch from 37abb4e to ab8519e Compare August 5, 2026 23:59
@fallintoplace fallintoplace changed the title fix(ipc): validate file block framing lengths fix(arrow/ipc): validate file block framing and lengths Aug 6, 2026
Comment thread arrow/ipc/file_reader.go
Comment thread arrow/ipc/file_reader.go
Comment thread arrow/ipc/metadata.go Outdated
Comment thread arrow/ipc/metadata.go
Comment thread arrow/ipc/metadata.go
@zeroshade
zeroshade merged commit 7a33e0b into apache:main Aug 10, 2026
40 of 41 checks passed
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.

2 participants