avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan Blue (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-1610) HttpTransceiver.java allocates arbitrary amount of memory
Date Thu, 01 Sep 2016 20:00:24 GMT

    [ https://issues.apache.org/jira/browse/AVRO-1610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15456456#comment-15456456
] 

Ryan Blue commented on AVRO-1610:
---------------------------------

The allocation is limited to Integer.MAX_VALUE, 2GB. That's big, but not necessarily going
to crash services. If this becomes a problem then we can add a configurable limit, but otherwise
I'm fine with the allocation proceeding.

> HttpTransceiver.java allocates arbitrary amount of memory
> ---------------------------------------------------------
>
>                 Key: AVRO-1610
>                 URL: https://issues.apache.org/jira/browse/AVRO-1610
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.7
>            Reporter: Philip Zeyliger
>
> In {{HttpTransceiver.java}}, Avro does:
> {code}
>       int length = (in.read()<<24)+(in.read()<<16)+(in.read()<<8)+in.read();
>       if (length == 0) {                       // end of buffers
>         return buffers;
>       }
>       ByteBuffer buffer = ByteBuffer.allocate(length);
> {code}
> This means that badly formatted input (like that produced by {{curl http://host/ --data
foo}} and many common security scanners) will trigger an OutOfMemory exception.  This is undesirable,
especially combined with setups that kill the process on out of memory exceptions.
> This bug is similar in spirit to AVRO-1111.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message