KAFKA-13518: Update gson dependency#11579
Conversation
21bff61 to
955e08a
Compare
showuon
left a comment
There was a problem hiding this comment.
@dongjinleekr , thanks for the PR. But there's spotBugs 4.5.2. Could you upgrade to the latest one? Also, the PR title/description can't tell what's the relationship between spotBugs and gson, could you add explanation there? Thanks.
showuon
left a comment
There was a problem hiding this comment.
Also, there are build errors. Please fix them. Thanks.
|
Hi @showuon, Here it is. I just updated the issue title more clearly and updated the spotbugs dependency into 4.5.2. |
showuon
left a comment
There was a problem hiding this comment.
Please also help fix the build failure. Thanks.
|
@showuon Sorry for bothering you. Here is the update. There were some updates on spotbugs between 4.2.2 and 4.5.2 and some previously-unfound problems are now detected:
|
showuon
left a comment
There was a problem hiding this comment.
@dongjinleekr , thanks for the update, but it looks like there are other failed spotBugs.
|
@showuon My bad. I found several other false-positives from other modules with spotbugs; They are now fixed. (Please see the comments.) 🙇 |
|
Thanks for the PR. Seems like the new version has more false positives. Do you know if they intend to fix those? |
Oh yes, as you can see in the updated PR, I updated spotbugs to 4.5.3 following the gradle plugin 5.0.5, and rebased onto the latest trunk. It seems like there are a bunch of false positives in the recent version of spotbugs (below) but, I verified that none of them are affecting. +1. They also have not fixed the issues I commented on in |
62fb35b to
2cd8ca1
Compare
|
Should we wait until they fix these issues in spotBugs? It doesn't look like the cost/benefit in upgrading here isn't favorable. |
|
@ijuma If you don't mind CVE WS-2021-0419 introduced by gson 2.8.6. This PR is to fix it. |
2cd8ca1 to
7bd7b86
Compare
|
Rebased onto the latest trunk. cc/ @ijuma |
|
Gson library has another recent vulnerability: https://nvd.nist.gov/vuln/detail/CVE-2022-25647. Gson library 2.8.9 fixes this, which is included in Spotbugs 4.5.0 and higher. |
7bd7b86 to
d4e9f36
Compare
|
@Boojapho Thanks for reporting. Here is the fix - rebased onto the latest trunk and upgraded spotbugs into 4.7.0, which also fixes the gson vulnerability. |
There was a problem hiding this comment.
Looks like spotbugs/spotbugs@720af6c would help, but it's not available in a released version yet.
There was a problem hiding this comment.
Disabled by default here spotbugs/spotbugs@7ba0e74 (not released yet).
There was a problem hiding this comment.
Why do we have to disable this one?
There was a problem hiding this comment.
- Public static
org.apache.kafka.server.metrics.KafkaYammerMetrics.defaultRegistry()may expose internal representation by returningKafkaYammerMetrics.metricsRegistry. - Public static
org.apache.kafka.common.security.auth.SecurityProtocol.names()may expose internal representation by returningSecurityProtocol.NAMES
There was a problem hiding this comment.
Are we disabling this one due to false positives?
There was a problem hiding this comment.
Yes.
- Random object created and used only once in new
kafka.tools.ConsoleConsumer$ConsumerConfig(String[]) - Random object created and used only once in new
kafka.tools.ConsumerPerformance$ConsumerPerfConfig(String[])
…D_HAVE_BEEN_A_NPE, EI_EXPOSE_STATIC_REP2
… to leave the workarounds later. 3. Reduce the scope of DMI_RANDOM_USED_ONLY_ONCE and MS_EXPOSE_REP into scala-only and some specific classes only, respectively.
d4e9f36 to
d193b71
Compare
|
@ijuma Here is the update:
|
|
Can you please update to spotbugs 4.7.1? It seems like it fixes the false positives. |
|
@dongjinleekr I have not seen this PR. I have raised draft PR #12768 to upgrade spotbugs. Can we update to spotbugs 4.7.3? |
|
Closing this PR in favour of #12768 |



Here is the fix. Since spotbugs 4.5.1 was released just 12 hours ago, it would take a little bit to be synched with maven central.
Committer Checklist (excluded from commit message)