Skip to content

[Python][C++] ipc::ReadSchema(const Message&) decodes non-Schema message header as org::apache::arrow::flatbuf::Schema #55368

Open

Description

@professor-moody

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

The ipc::ReadSchema(io::InputStream*, ...) overload and UnpackSchemaMessage both check that the incoming message has MessageType::SCHEMA before decoding it. However, the ipc::ReadSchema(const Message&, ...) overload in cpp/src/arrow/ipc/reader.cc does not check message.type(): it passes message.header() directly to internal::GetSchema, which casts the FlatBuffer root table to org::apache::arrow::flatbuf::Schema.

When a RecordBatch or DictionaryBatch Message is passed to ipc::ReadSchema(const Message&, ...) (including via pyarrow.ipc.read_schema(message)), its header table was verified only for that message type, and reading it through the Schema FlatBuffer accessors interprets its fields with the wrong table layout instead of returning an Invalid / IOError status.

Expected behavior

ipc::ReadSchema(const Message&, ...) should validate CHECK_MESSAGE_TYPE(MessageType::SCHEMA, message.type()); before calling internal::GetSchema, matching the stream overload and returning the same IOError when given a non-Schema message.

Component(s)

C++, Python

Activity

  1. changed the title [-][C++] ipc::ReadSchema(const Message&) decodes non-Schema message header as org::apache::arrow::flatbuf::Schema[/-] [+][Python][C++] ipc::ReadSchema(const Message&) decodes non-Schema message header as org::apache::arrow::flatbuf::Schema[/+] on Nov 2, 2026
  2. added a commit that references this issue on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions