Skip to content

Upgrade guava to 32.1.0-jre due CVE-2023-2976#23127

Merged
tdcmeehan merged 1 commit intoprestodb:masterfrom
denodo-research-labs:cve_2023_2976_guava
Jul 24, 2024
Merged

Upgrade guava to 32.1.0-jre due CVE-2023-2976#23127
tdcmeehan merged 1 commit intoprestodb:masterfrom
denodo-research-labs:cve_2023_2976_guava

Conversation

@denodo-research-labs
Copy link
Contributor

@denodo-research-labs denodo-research-labs commented Jul 3, 2024

Description

Presto issue #22841

Motivation and Context

Solve CVE of severity HIGH.

Contributor checklist

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

General Changes
* Upgrade guava to 32.1.0-jre due CVE-2023-2976 :pr:`23127`


@denodo-research-labs denodo-research-labs requested a review from a team as a code owner July 3, 2024 10:54
checkArgument(bucketNumber.isPresent(), "bucketNumber must be present");
if (!allSplitLoaded.isDone()) {
return allSplitLoaded.transform(ignored -> ImmutableList.of(), executor);
return FluentFuture.from(allSplitLoaded).transform(ignored -> ImmutableList.of(), executor);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this change related?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes a compilation error due to this change introduced in Guava 27.0: AbstractFuture doesn't expose FluentFuture APIs anymore

<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
<artifactId>checker-qual</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do these need to be excluded?

Also, groupId conventionally comes before artifactId. This made me look twice.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: groupid before artifactid.

Only failureaccess is needed, all others are excluded.

<dep.jayway.version>2.6.0</dep.jayway.version>
<dep.ratis.version>2.2.0</dep.ratis.version>
<dep.errorprone.version>2.18.0</dep.errorprone.version>
<dep.guava.version>32.1.0-jre</dep.guava.version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where was this set before? Was this pulled in via airlift? If so, we might want to update airlift instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guava version is pulled via airbase, but we see no movement on the forked airbase regarding to version upgrades.

errorprone version is introduced in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally don't know why we use airbase, but I assume there's a reason. Given that we do, I think the default approach is to fix that rather introducing the new guava version here. Otherwise it's still possible we'll pull in the wrong guava version somewhere and have dependency convergence issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that in the past airbase was used to pull versions, but it does not appear to be the approach being used now:

  • the pom also overrides other versions declared in airbase such as slf4j, jackson, joda, etc...
  • airbase v102 is in use since May 2021

<dep.errorprone.version>2.18.0</dep.errorprone.version>
<dep.guava.version>32.1.0-jre</dep.guava.version>
<dep.jackson.version>2.11.0</dep.jackson.version>
<dep.j2objc.version>2.8</dep.j2objc.version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need j2bjc? I see it in a few poms, but not in Java code anywhere. Can we instead remove it where it appears?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we need it. It is often used in the guava code, e.g. in com.google.common.util.concurrent.AbstractFuture class, and this class is used via com.google.common.util.concurrent.SettableFuture by com.facebook.presto.hive.HiveSplitSource

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but shouldn't guava supply that then? Does it need to be in our poms?

Also should we just use the guava BOM instead of setting these dependencies up manually?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are pinning the version to avoid conflicts among different versions of the same dependency (Maven Enforcer plugin).

@tdcmeehan tdcmeehan self-assigned this Jul 24, 2024
@tdcmeehan tdcmeehan merged commit 578aec4 into prestodb:master Jul 24, 2024
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
<groupId>com.google.errorprone</groupId>
Copy link
Contributor

@agrawaldevesh agrawaldevesh Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is wrong and is causing shading issues in presto-jdbc: org/checkerframework is now creeping into presto-jdbc jar. The groupId should be org.checkerframework for the checker-qual

Please fix asap.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fixing this in #23304

Copy link
Contributor

@agrawaldevesh agrawaldevesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the highlighted issue asap since this is breaking projects that use presto-jdbc

@agrawaldevesh agrawaldevesh mentioned this pull request Jul 26, 2024
6 tasks
@tdcmeehan tdcmeehan mentioned this pull request Aug 23, 2024
34 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants