You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "patrickswedish (via GitHub)" <gi...@apache.org> on 2026/10/19 18:13:31 UTC

[PR] fix: ParquetMetaDataPushDecoder bounds check metadata length against file size (#11690) [arrow-rs]

patrickswedish opened a new pull request, #11723:
URL: https://github.com/apache/arrow-rs/pull/11723

   # Which issue does this PR close?
   
   - Closes #11690
   
   # Rationale for this change
   
   In `ParquetMetaDataPushDecoder::try_decode`, the start of metadata was calculated without bounds checking `metadata_len` against `file_len`:
   ```rust
   let metadata_len: u64 = footer_tail.metadata_length() as u64;
   let metadata_start = file_len - footer_len - metadata_len;
   ```
   If a corrupted or truncated footer claims a metadata length such that `file_len < footer_len + metadata_len`, this underflows and panics (`attempt to subtract with overflow` in debug, slice panic in release).
   
   # What changes are included in this PR?
   
   - Adds an explicit check in `DecodeState::ReadingMetadata` verifying that `file_len >= footer_len + metadata_len`.
   - Returns `Err(eof_err!("Parquet file too small. Size is {} but need {}", file_len, footer_len + metadata_len))` matching `ParquetMetaDataReader::parse_and_finish`.
   - Adds regression unit test `test_metadata_length_exceeds_file_size`.
   
   # Are these changes tested?
   
   Yes, added unit test `test_metadata_length_exceeds_file_size` in `push_decoder.rs` asserting the structured `EOF` error.
   
   # Are there any significant user-facing changes?
   
   No breaking changes. Push decoder returns a structured `ParquetError::EOF` instead of panicking on malformed inputs.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: ParquetMetaDataPushDecoder bounds check metadata length against file size (#11690) [arrow-rs]

Posted by "etseidl (via GitHub)" <gi...@apache.org>.
etseidl commented on PR #11723:
URL: https://github.com/apache/arrow-rs/pull/11723#issuecomment-6284701165

   Thanks for the submission @patrickswedish, but the referenced issue has already been fixed and closed. I'm going to close this as a duplicate, but please re-open if you think this was closed in error.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: ParquetMetaDataPushDecoder bounds check metadata length against file size (#11690) [arrow-rs]

Posted by "patrickswedish (via GitHub)" <gi...@apache.org>.
patrickswedish commented on PR #11723:
URL: https://github.com/apache/arrow-rs/pull/11723#issuecomment-6284865330

   Thanks Ed (@etseidl), completely missed that #11697 was already queued. Appreciate the review and heads up!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: ParquetMetaDataPushDecoder bounds check metadata length against file size (#11690) [arrow-rs]

Posted by "etseidl (via GitHub)" <gi...@apache.org>.
etseidl closed pull request #11723: fix: ParquetMetaDataPushDecoder bounds check metadata length against file size (#11690)
URL: https://github.com/apache/arrow-rs/pull/11723


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org