You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ParquetMetaDataReader::decode_metadata reserves capacity from two counts read from the footer before checking that the input can hold them. A corrupt footer that claims about 2^31 entries makes the process abort on a failed allocation instead of returning an error.
Row groups, file/metadata/thrift/mod.rs (59.3.1, line 815): Vec::with_capacity(list_ident.size as usize). read_thrift_vec already guards the same pattern ("Thrift list size {} exceeds remaining input length {}", parquet_thrift.rs:739), but this call site does not.
SchemaElement.num_children, schema/types.rs (59.3.1, line 1403): Vec::with_capacity(usize::try_from(n)?), where n is not bounded by the number of schema elements.
Also present in 59.3.2.
To Reproduce
For case 1, decode this 17-byte FileMetaData (Thrift compact): version 1, a one-element schema, num_rows 0, then row_groups as a list header claiming 2147483647 structs: 15 02 19 1C 48 01 72 00 16 00 19 FC FF FF FF FF 07 ParquetMetaDataReader::decode_metadata(&bytes) asks for about 206 GB and the process aborts.
Expected behavior
An Err(ParquetError) in both cases: bound the row-group count by prot.remaining_bytes() as read_thrift_vec does, and reject num_children greater than the number of schema elements.
Additional context
While decoding footers received from another process - one bad footer causes the reader to crash
This issue is irresistible honey for AI bots. I'm taking ownership defensively. I'll address it in due time. Happy to bump priority if this is an actual problem in a real workflow.
Activity
huong8373tt-beep commentedon Nov 1, 2026
take
etseidl commentedon Nov 2, 2026
This issue is irresistible honey for AI bots. I'm taking ownership defensively. I'll address it in due time. Happy to bump priority if this is an actual problem in a real workflow.
fix(parquet): Harden Thrift decoding of binary lengths and collection…