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
{{ message }}
Repository navigation
[Java][FlightRPC] Unbounded allocation from untrusted FlightData frame length prefix in ArrowMessage.frame #1317
ArrowMessage.frame deserializes incoming FlightData frames. It is installed as the gRPC request marshaller for DoPut and DoExchange (FlightBindingService), so it runs server-side on bytes from any connected client.
For each wire field it reads a length prefix with readRawVarint32 and then allocates that many bytes before reading any content:
DESCRIPTOR_TAG / HEADER_TAG: byte[] bytes = new byte[size];
size comes straight off the wire and is never checked against the bytes actually present. The new byte[size] paths allocate on the JVM heap and bypass the BufferAllocator limit entirely, so a tiny crafted frame declaring a length near Integer.MAX_VALUE forces a multi-gigabyte allocation (OutOfMemoryError / GC thrash) during request deframing, before the application sees or authenticates the stream.
A field can never be longer than the bytes still buffered for the message, so the declared length can be validated against stream.available() (the frame parser already relies on available() as its loop guard).
Activity
apacheGH-1317: Bound field reads on non-KnownLength streams and relea…
apacheGH-1317: bound FlightData frame field length before allocating (a…