thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Toby Thain (JIRA)" <>
Subject [jira] [Commented] (THRIFT-1205) port server unduly fragile with arbitrary input
Date Sat, 18 Jun 2011 14:41:47 GMT


Toby Thain commented on THRIFT-1205:

Actually, readFrame() is free to read the frame in chunks of any size, avoiding the need for
upfront allocation, though when (if) fully read they would need to be assembled into a single
byte[] given the current deserializer interface.

It seems to me that this can be solved for all transports by having the deserializer ask for
chunks instead of walking a whole frame: it's trivial to pretend a complete buffer is a nonblocking
stream but pretending a blocking stream is a buffer leads to difficulties like those discussed

> port server unduly fragile with arbitrary input
> -----------------------------------------------
>                 Key: THRIFT-1205
>                 URL:
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.6.1
>         Environment: javac 1.5.0_19, OS X 10.4.11
>            Reporter: Toby Thain
>            Priority: Critical
>              Labels: security
> Telnetting to the port and type a couple of arbitrary characters crashes the server almost
immediately as follows. I haven't glanced at the relevant code. Is this reproducible on other
> {noformat}
> $ ./ 
> Starting the simple server...
> Exception in thread "Thread-0" java.lang.OutOfMemoryError: Java heap space
>         at org.apache.thrift.protocol.TBinaryProtocol.readStringBody(
>         at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(
>         at SimonSays$Processor.process(Unknown Source)
>         at org.apache.thrift.server.TSimpleServer.serve(
>         at JavaServer.simple(Unknown Source)
>         at JavaServer$ Source)
>         at
> {noformat}

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message