Skip to content

[C++][Parquet] Unsanitized usage of uint32_t lengths accross Parquet metadata reads #50971

Closed

Description

@pitrou

Describe the bug, including details regarding any error messages, version, and platform.

The Parquet reader uses disparate types for handling lengths of file components: most of the time int64_t, but sometimes also uint32_t or int32_t (especially when Thrift deserialization is involved, due to the Thrift C++ APIs).

This leads to fragilities and potential issues. This can be seen here:

if (footer_read_size >= (metadata_len + kFooterSize)) {

where we are adding two uint32_ts without regard for potential addition overflow.

We should strive to use int64_t almost everywhere, only switching to narrower types when calling into third-party APIs that use such types.

Kudos to Ada Logics and Claude for submitting a more detailed example of invalid pointer read.

Component(s)

C++, Parquet

Activity

  1. pitrou commented on Aug 24, 2026

    @pitrou
    MemberAuthor
  2. added a commit that references this issue on Aug 24, 2026
  3. added 5 commits that reference this issue on Aug 24, 2026
  4. added this to the 26.0.0 milestone on Aug 25, 2026
  5. pitrou commented on Aug 25, 2026

    @pitrou
    MemberAuthor

    Issue resolved by pull request 50972
    #50972

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions