Skip to content

[C++] Unbounded memory allocation in ReadMessageContinued #55476

Closed

Description

@pitrou

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

In the IPC reader, when a subset of column is asked for, we currently allocate an entire buffer with the same size as the body size advertised in the IPC message:

// Selective field loading: allocate a body buffer and read only the
// requested field ranges into it.
DCHECK_NE(file, nullptr);
ARROW_ASSIGN_OR_RAISE(
body, AllocateBuffer(decoder->next_required_size(), default_memory_pool()));
RETURN_NOT_OK(ReadFieldsSubset(offset, file, fields_loader,
SliceBuffer(metadata, 0, metadata_length),
decoder->next_required_size(), body));

Unfortunately, this can be an unbounded allocation if the advertised body size in the IPC message exceeds the file size. This opens the door to denial of service attacks.

Furthermore, the allocation uses the default memory pool instead of a user-configured memory pool.

Component(s)

C++

Activity

  1. self-assigned this
    on Nov 10, 2026
  2. added 4 commits that reference this issue on Nov 16, 2026
  3. added this to the 27.0.0 milestone on Nov 17, 2026
  4. pitrou commented on Nov 17, 2026

    @pitrou
    MemberAuthor

    Issue resolved by pull request 55634
    #55634

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