Skip to content

[format] Validate blob file footer and index metadata - #9223

Merged
JingsongLi merged 1 commit into
apache:masterfrom
Stephen0421:blob-file-meta-validation
Aug 15, 2026
Merged

[format] Validate blob file footer and index metadata#9223
JingsongLi merged 1 commit into
apache:masterfrom
Stephen0421:blob-file-meta-validation

Conversation

@Stephen0421

Copy link
Copy Markdown
Contributor

Purpose

Harden BLOB file metadata parsing against corrupt or truncated footer and index data.

This change:

  • Validates the minimum footer size and index boundaries before seeking or allocating memory.
  • Rejects malformed compressed indexes with a descriptive IOException.
  • Validates record-length sentinels, minimum record length, and the total indexed data size.
  • Validates selection cardinality and selected record positions.
  • Preserves the existing lazy payload-reading behavior.

Test

  • Added BlobFileMetaTest covering:
    • Truncated files.
    • Invalid index lengths and malformed indexes.
    • Unsupported versions.
    • Invalid record lengths and mismatched data-region sizes.
    • NULL and placeholder sentinels.
    • Empty, non-contiguous, and out-of-range selections.

@JingsongLi JingsongLi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@JingsongLi
JingsongLi merged commit 4dba8f8 into apache:master Aug 15, 2026
12 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