Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.9
-
None
-
Patch Available
Description
In TSaslTransport#receiveSaslMessage, we are doing two things incorrectly:
- Not validating the status byte code.
- Not validating the decoded payload size integer before allocating a whole array with it.
The latter especially is bad when a network security software sends a thrift server port some garbage data, causing it to receive failures like:
java.lang.OutOfMemoryError: Java heap space at org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:181) at org.apache.thrift.transport.TSaslServerTransport.handleSaslStartMessage(TSaslServerTransport.java:125) at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:253)
Or even,
ERROR org.apache.thrift.server.TThreadPoolServer: Error occurred during processing of message. java.lang.NegativeArraySizeException at org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:181) at org.apache.thrift.transport.TSaslServerTransport.handleSaslStartMessage(TSaslServerTransport.java:125) at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:253)
Attachments
Attachments
Issue Links
- is related to
-
HIVE-6468 HS2 & Metastore using SASL out of memory error when curl sends a get request
- Closed
- relates to
-
THRIFT-2678 Make max message size configurable
- Closed