Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade libthrift to 0.14.1 due CVE-2020-13949 #24462

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>0.9.3-1</version>
<version>0.14.1</version>
<exclusions>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
Expand All @@ -1456,6 +1456,10 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down
11 changes: 11 additions & 0 deletions presto-accumulo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@
<dep.reload4j.version>1.2.18.3</dep.reload4j.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<!-- libthrift >= 0.14.1 not compatible with accumulo-minicluster 1.x -->
<version>0.9.3-1</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.apache.accumulo</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.facebook.presto.hive.authentication.HiveMetastoreAuthentication;
import com.google.common.net.HostAndPort;
import org.apache.thrift.TConfiguration;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
Expand Down Expand Up @@ -217,5 +218,24 @@ public void flush()
throw rewriteException(e, address);
}
}

// Methods added in libthrift 0.14.0 and not present in Hive Metastore <= 3.1.2
@Override
public TConfiguration getConfiguration()
{
return TConfiguration.DEFAULT;
}

@Override
public void updateKnownMessageSize(long size)
throws TTransportException
{
}

@Override
public void checkReadBytesAvailable(long numBytes)
throws TTransportException
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.hadoop.security.token.TokenIdentifier;
import org.apache.thrift.transport.TSaslClientTransport;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;

import javax.inject.Inject;
import javax.security.auth.callback.Callback;
Expand Down Expand Up @@ -98,6 +99,9 @@ private TTransport authenticateWithToken(TTransport rawTransport, String tokenSt
catch (IOException ex) {
throw new UncheckedIOException(ex);
}
catch (TTransportException e) {
throw new RuntimeException(e);
}
}

private static class SaslClientCallbackHandler
Expand Down Expand Up @@ -175,5 +179,8 @@ private TTransport authenticateWithHost(TTransport rawTransport, String hiveMeta
catch (IOException e) {
throw new UncheckedIOException(e);
}
catch (TTransportException e) {
throw new RuntimeException(e);
}
}
}
Loading