-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Upgrade vulnerable version of reload4j and aws-java-sdk dependencies #24606
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 vulnerable version of reload4j and aws-java-sdk dependencies #24606
Conversation
ca2dee0 to
46e1d2a
Compare
|
Thanks for the release note entry! Suggest linking to the relevant CVEs. See Phrasing in the Release Notes Guidelines for an example. |
Thanks, @steveburnett for your feedback. I have updated the release note based on your suggestions. |
Thanks for updating the release note entry! Sorry about making a mistake in my suggested draft - could you fix my typo in the second line? "Upgrad reload4j" should be "Upgrade reload4j". |
pom.xml
Outdated
| <dep.slice.version>0.38</dep.slice.version> | ||
| <dep.testing-mysql-server-5.version>0.6</dep.testing-mysql-server-5.version> | ||
| <dep.aws-sdk.version>1.12.560</dep.aws-sdk.version> | ||
| <dep.aws-sdk.version>1.12.640</dep.aws-sdk.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShahimSharafudeen Looks like even version 1.12.640 has CVEs for artifact aws-java-sdk-core that uses this SDK version in Presto.
https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-core/1.12.640 (But it looks like those CVEs are in test dependencies)
Other 2 AWS artifact aws-java-sdk-glue & aws-java-sdk-s3 are CVEs free even with existing aws version 1.12.560
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agrawalreetika - If we check version 1.12.560, we can see that an ion-java vulnerability exists there. In version 1.12.640, it was resolved and has no vulnerabilities. So, we used the resolved version here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just upgrade to the latest version (1.12.782) to ensure it solves as many CVEs as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
presto-accumulo/pom.xml
Outdated
| <dep.accumulo.version>1.10.1</dep.accumulo.version> | ||
| <dep.curator.version>2.12.0</dep.curator.version> | ||
| <dep.reload4j.version>1.2.18.3</dep.reload4j.version> | ||
| <dep.reload4j.version>1.2.22</dep.reload4j.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this upgrade? I see exsiting and new both the version has CVEs coming from test dependencies-
https://mvnrepository.com/artifact/ch.qos.reload4j/reload4j/1.2.18.3
https://mvnrepository.com/artifact/ch.qos.reload4j/reload4j/1.2.22
I don't see that's resolved even on latest version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agrawalreetika - Regarding the reload4j dependency, we can see a vulnerability identified by the Mend tool scan (OSS Scan - WS-2022-0467), which is also described in the PR description. The fix is only available in reload4j version 1.2.22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just upgrade to the latest (1.2.26) if it does actually resolve a CVE. However, as Reetika pointed out, the mvnrepository link shows the CVE has not been resolved in any new version.
@ShahimSharafudeen can you link to the specific CVE the scan was reporting. The github issue linked has no attached CVE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShahimSharafudeen What's your response to Reetika and Zac's comments? I see this line is deleted from the second commit, so here the change should be reverted because it doesn't fix the CVE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yingsu00 - When upgrading the Reload4j version, Zookeeper fails to start in the test runs due to a missing Log4j dependency, and we couldn't fix it. Therefore, @ZacBlanco suggested removing the Reload4j dependency and adding the org.apache.logging.log4j dependencies instead, to ensure Zookeeper loads as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to add - reload4j was just a way to allow accumulo and zookeeper to use their log4j 1.x API even when the implementation is 2.0. Since reload4j was the dependency with the CVE, I recommended we remove it entirely to resolve the CVE and just use the log4j 1.X API facade dependency instead
presto-accumulo/pom.xml
Outdated
| <dep.accumulo.version>1.10.1</dep.accumulo.version> | ||
| <dep.curator.version>2.12.0</dep.curator.version> | ||
| <dep.reload4j.version>1.2.18.3</dep.reload4j.version> | ||
| <dep.reload4j.version>1.2.22</dep.reload4j.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just upgrade to the latest (1.2.26) if it does actually resolve a CVE. However, as Reetika pointed out, the mvnrepository link shows the CVE has not been resolved in any new version.
@ShahimSharafudeen can you link to the specific CVE the scan was reporting. The github issue linked has no attached CVE.
pom.xml
Outdated
| <dep.slice.version>0.38</dep.slice.version> | ||
| <dep.testing-mysql-server-5.version>0.6</dep.testing-mysql-server-5.version> | ||
| <dep.aws-sdk.version>1.12.560</dep.aws-sdk.version> | ||
| <dep.aws-sdk.version>1.12.640</dep.aws-sdk.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just upgrade to the latest version (1.12.782) to ensure it solves as many CVEs as possible.
|
I played around with this myself. I think I have a better solution for the reload4j bits. We can remove reload4j entirely and just migrate to using the log4j-1.2 facade instead. Here is a diff. We might want to move the log4j dependencies out of the test scoped dependency section though diff --git a/presto-accumulo/pom.xml b/presto-accumulo/pom.xml
index bc6ccad6f6..3d614af547 100644
--- a/presto-accumulo/pom.xml
+++ b/presto-accumulo/pom.xml
@@ -16,7 +16,6 @@
<air.main.basedir>${project.parent.basedir}</air.main.basedir>
<dep.accumulo.version>1.10.1</dep.accumulo.version>
<dep.curator.version>2.12.0</dep.curator.version>
- <dep.reload4j.version>1.2.22</dep.reload4j.version>
</properties>
<dependencyManagement>
@@ -265,20 +264,6 @@
<artifactId>jackson-databind</artifactId>
</dependency>
- <dependency>
- <groupId>ch.qos.reload4j</groupId>
- <artifactId>reload4j</artifactId>
- <version>${dep.reload4j.version}</version>
- </dependency>
-
- <!-- log4j removed from reload4j version 1.2.18.4-->
- <dependency>
- <groupId>org.apache.logging.log4j</groupId>
- <artifactId>log4j-1.2-api</artifactId>
- <version>2.24.3</version>
- <scope>test</scope>
- </dependency>
-
<!-- Presto SPI -->
<dependency>
<groupId>com.facebook.presto</groupId>
@@ -359,6 +344,22 @@
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-1.2-api</artifactId>
+ <version>${dep.log4j.version}</version>
+ </dependency>
</dependencies>
<profiles>
@@ -377,21 +378,4 @@
</build>
</profile>
</profiles>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.basepom.maven</groupId>
- <artifactId>duplicate-finder-maven-plugin</artifactId>
- <configuration>
- <ignoredResourcePatterns>
- <ignoredResourcePattern>org/apache/log4j/xml/log4j.dtd</ignoredResourcePattern>
- </ignoredResourcePatterns>
- <ignoredClassPatterns>
- <ignoredClassPattern>org.apache.log4j.*</ignoredClassPattern>
- </ignoredClassPatterns>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>Also, can you split this PR into two separate commits - one for the log4j upgrade, one for the AWS SDK upgrade? In case there are issues, it will make a revert easier in the future. |
Ya sure @ZacBlanco . |
46e1d2a to
68749f7
Compare
|
@ZacBlanco - Updated the changes and commits as as per above comment. |
ZacBlanco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last thing
68749f7 to
fd5a0fd
Compare
ZacBlanco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the improvements @ShahimSharafudeen !
|
@yingsu00 / @jaystarshot Can you please have a look whenever you get a chance? Thanks. |
|
@ShahimSharafudeen you'll need to rebase your PR in order to merge due to the updated github status checks |
fd5a0fd to
283e7d4
Compare
|
@ShahimSharafudeen Test failures are relevant to the change. Can you please fix? |
e82f2bd
0892107 to
455cf97
Compare
Remove the reload4j dependency and add the org.apache.logging.log4j dependency for log4j support in response to WS-2022-0467
455cf97 to
3bdc0dd
Compare
@ZacBlanco - Rebased the PR and all checks are passed. |
@yingsu00 - Fixed all test failures after rebase. |
|
@yingsu00 please look again and merge when convenient, thanks! |
Description
Log4j was removed from the reload4j version 1.2.18.4. Therefore, if we upgrade this dependency, it will cause a Cannot instantiate class TestNGException in the Presto-accum module test classes. To resolve this issue, we are adding the latest version of the Apache Log4j 1.x Compatibility API.
Motivation and Context
To resolve the vulnerability issues on the aws-java-sdk and reload4j dependencies.
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.