Skip to content

deps: override guava, jackson-core and opentelemetry in shaded jars to fix CVEs - #4647

Open
davidrabinowitz wants to merge 2 commits into
googleapis:mainfrom
davidrabinowitz:cve-fixes
Open

davidrabinowitz wants to merge 2 commits into
googleapis:mainfrom
davidrabinowitz:cve-fixes

Conversation

@davidrabinowitz

Copy link
Copy Markdown

Problem

bigtable-hbase-1.x-shaded and bigtable-hbase-2.x-shaded (and therefore the -hadoop jars built from them) bundle relocated copies of the google-cloud-bigtable dependency tree. With google-cloud-bigtable 2.85.0 that tree resolves three libraries with known vulnerabilities (OSV.dev):

Bundled artifact Advisories
com.fasterxml.jackson.core:jackson-core:2.18.3 CVE-2026-18401, CVE-2026-68494, CVE-2026-89407, CVE-2026-89425
com.google.guava:guava:33.6.0-jre CVE-2026-102554
io.opentelemetry:opentelemetry-api:1.62.0 CVE-2026-118259

Bumping the veneer alone does not fix this: the dependency BOM behind google-cloud-bigtable 2.88.0 moves jackson to 2.22.4 but still manages guava 33.6.0-jre and opentelemetry 1.62.0.

Changes

  • Root pom.xml: guava.version 33.4.0-jre → 33.7.2-jre, and new jackson-core.version (2.18.12) and opentelemetry.version (1.67.0) properties, with a comment saying when the overrides can be removed.
  • bigtable-hbase-1.x-shaded, bigtable-hbase-2.x-shaded: explicit dependencyManagement entries for guava, jackson-core and the nine io.opentelemetry artifacts the veneer uses (API, context, common and the SDK modules are kept on one version). Explicit entries take precedence over the imported veneer BOMs.
  • Same two modules, verify-mirror-deps against google-cloud-bigtable: the overridden artifacts are added to ignoredDependencies, since they are now deliberately newer than the veneer's versions.
  • bigtable-hbase-mirroring-client-1.x-shaded, -2.x-shaded: add an org.jspecify relocation. bigtable-hbase-mirroring-client-core uses guava.version, and guava 33.7.2-jre depends on jspecify instead of checker-qual; without the relocation verify-shaded-jar-entries fails on unrelocated org/jspecify/annotations classes.

The overrides are scoped to the shaded modules rather than the root dependencyManagement, so the unshaded modules keep mirroring the veneer and HBase dependency versions exactly.

Verification

  • CVE scan: the 93 artifacts bundled into bigtable-hbase-2.x-hadoop were queried against OSV.dev before and after: 6 findings before, 0 after. bigtable-hbase-1.x-shaded bundles the same third-party set.
  • Jar contents: the built bigtable-hbase-2.x-hadoop jar reports guava 33.7.2-jre, jackson-core 2.18.12 and OpenTelemetry SDK 1.67.0.
  • Build: mvn clean install -Dclirr.skip=true with unit tests forked on JDK 11 passes for 44 of 45 modules, including the shaded, hadoop and mirroring-client modules and their verify-* checks.
  • Not built locally: bigtable-beam-import. My local Maven mirror is missing several io.netty:*:4.1.133.Final artifacts that Beam 2.77.0 requires, so dependency resolution fails before compilation. This PR does not touch that module or netty; relying on CI for it.
  • Not run: integration tests against Bigtable or the emulator.

Not addressed

bigtable-hbase-2.x-hadoop also declares hbase-client 2.6.4-hadoop3 as a regular (non-bundled) dependency. Its transitive dependencies (for example guava 27.0-jre, netty 4.1.105.Final, zookeeper 3.8.4, bcprov-jdk18on 1.78.1, jackson-databind 2.12.7.1, protobuf-java 2.5.0) have known advisories of their own. They come from HBase/Hadoop, are not inside the jar, and are left for a separate change.

Checklist

…o fix CVEs

The bigtable-hbase-1.x/2.x-shaded jars, and the -hadoop jars built from them, bundle relocated copies of libraries resolved through google-cloud-bigtable 2.85.0. An OSV scan of the artifacts bundled into bigtable-hbase-2.x-hadoop flagged three of them:

- guava 33.6.0-jre: CVE-2026-102554
- jackson-core 2.18.3: CVE-2026-18401, CVE-2026-68494, CVE-2026-89407, CVE-2026-89425
- opentelemetry-api 1.62.0: CVE-2026-118259

Manage them up to patched releases: guava 33.7.2-jre, jackson-core 2.18.12 and opentelemetry 1.67.0. OSV reports no known vulnerabilities for these versions.

Bumping the veneer is not enough. google-cloud-bigtable 2.88.0, the latest release, only picks up a fixed jackson-core and still resolves the vulnerable guava and opentelemetry versions.

The versions are properties in the root pom, but the dependencyManagement entries live in the two shaded modules rather than the root. Root-level pins would apply to every module, trip the verify-mirror-deps checks that compare modules against hbase and the veneer, and could downgrade jackson-core in the Beam modules. Scoping the overrides to the modules that bundle these libraries keeps the rest of the build aligned with its upstream BOMs.

Every opentelemetry artifact the veneer uses is listed, not just the API, because the SDK must not be older than the API. The overridden artifacts are added to the ignore list of the veneer mirror check in both shaded modules, since they now differ from the veneer on purpose.

guava.version was previously 33.4.0-jre and is also used by bigtable-hbase-mirroring-client-core, which moves to 33.7.2-jre as well.

This covers only what is bundled in the jars. The unshaded transitive dependencies of hbase-client 2.6.4-hadoop3 that bigtable-hbase-2.x-hadoop declares (netty, zookeeper, jackson-databind, bouncycastle and others) are unchanged.

Each override can be removed once the veneer's deps-bom ships the same or a newer version.
The previous commit raised guava.version from 33.4.0-jre to 33.7.2-jre
to pick up the fix for CVE-2026-102554. That property is also used by
bigtable-hbase-mirroring-client-core, so the mirroring-client shaded
jars now bundle the newer Guava as well.

Guava 33.7.2-jre depends on org.jspecify:jspecify instead of
checker-qual. The mirroring-client shaded jars only relocated
org.checkerframework, so the jspecify annotation classes landed in the
jar under their original package and verify-shaded-jar-entries failed
the build of bigtable-hbase-mirroring-client-1.x-shaded:

  Found forbidden entries in the shaded jar:
  org/jspecify/annotations/NonNull.class
  org/jspecify/annotations/NullMarked.class
  org/jspecify/annotations/NullUnmarked.class
  org/jspecify/annotations/Nullable.class

Relocate org.jspecify under the shading prefix, next to the existing
org.checkerframework relocation. The 2.x shaded module has the same
relocation set and bundles the same Guava, so it gets the same change.

Relocating was chosen over pinning these modules back to Guava
33.4.0-jre, which would have kept the vulnerable release in the
mirroring-client jars.
@davidrabinowitz
davidrabinowitz requested a review from a team as a code owner November 20, 2026 05:12
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: bigtable Issues related to the googleapis/java-bigtable-hbase API. labels Nov 20, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces security overrides for Guava, Jackson Core, and OpenTelemetry dependencies across shaded modules to address known CVEs, and adds shading relocations for org.jspecify. Feedback on the changes includes a recommendation to isolate the Guava version override to shaded modules using a separate property to avoid unintentionally upgrading unshaded modules. Additionally, a correction is suggested in the bigtable-hbase-2.x-shaded POM where tags were incorrectly used instead of within the block.

Comment thread pom.xml
Comment on lines +90 to +98
<!-- Security overrides. google-cloud-bigtable ${bigtable.version} still resolves releases of
these libraries that have known CVEs. They are bundled into the
bigtable-hbase-{1,2}.x-shaded (and therefore the -hadoop) jars, so those modules manage
them up to the patched releases below. Remove an override once the veneer's deps-bom
ships the same or a newer version.
guava.version is also referred from bigtable-hbase-mirroring-client-core. -->
<guava.version>33.7.2-jre</guava.version>
<jackson-core.version>2.18.12</jackson-core.version>
<opentelemetry.version>1.67.0</opentelemetry.version>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

By upgrading guava.version directly in the root pom.xml, unshaded modules that reference ${guava.version} (such as bigtable-beam-import and bigtable-emulator) will also have their Guava version upgraded to 33.7.2-jre. This contradicts the goal of keeping unshaded modules mirroring the veneer's dependency versions exactly (which is 33.4.0-jre).\n\nTo keep the overrides strictly scoped to the shaded modules:\n1. Keep guava.version at 33.4.0-jre in the root pom.xml.\n2. Define a new property for the override, e.g., <guava-override.version>33.7.2-jre</guava-override.version>.\n3. Use ${guava-override.version} in the dependencyManagement of bigtable-hbase-1.x-shaded and bigtable-hbase-2.x-shaded.\n4. Add a dependencyManagement section to bigtable-hbase-mirroring-client-1.x-shaded and 2.x-shaded to override guava to ${guava-override.version} during shading, while leaving the unshaded bigtable-hbase-mirroring-client-core on the standard ${guava.version}.

Comment on lines +522 to +532
<dependency>com.google.guava:guava</dependency>
<dependency>com.fasterxml.jackson.core:jackson-core</dependency>
<dependency>io.opentelemetry:opentelemetry-api</dependency>
<dependency>io.opentelemetry:opentelemetry-context</dependency>
<dependency>io.opentelemetry:opentelemetry-common</dependency>
<dependency>io.opentelemetry:opentelemetry-sdk</dependency>
<dependency>io.opentelemetry:opentelemetry-sdk-common</dependency>
<dependency>io.opentelemetry:opentelemetry-sdk-metrics</dependency>
<dependency>io.opentelemetry:opentelemetry-sdk-trace</dependency>
<dependency>io.opentelemetry:opentelemetry-sdk-logs</dependency>
<dependency>io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi</dependency>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with bigtable-hbase-1.x-shaded/pom.xml and to adhere to standard Maven conventions for list element naming, consider using <ignoredDependency> instead of <dependency> inside the <ignoredDependencies> block.

Suggested change
<dependency>com.google.guava:guava</dependency>
<dependency>com.fasterxml.jackson.core:jackson-core</dependency>
<dependency>io.opentelemetry:opentelemetry-api</dependency>
<dependency>io.opentelemetry:opentelemetry-context</dependency>
<dependency>io.opentelemetry:opentelemetry-common</dependency>
<dependency>io.opentelemetry:opentelemetry-sdk</dependency>
<dependency>io.opentelemetry:opentelemetry-sdk-common</dependency>
<dependency>io.opentelemetry:opentelemetry-sdk-metrics</dependency>
<dependency>io.opentelemetry:opentelemetry-sdk-trace</dependency>
<dependency>io.opentelemetry:opentelemetry-sdk-logs</dependency>
<dependency>io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi</dependency>
<ignoredDependency>com.google.guava:guava</ignoredDependency>\n <ignoredDependency>com.fasterxml.jackson.core:jackson-core</ignoredDependency>\n <ignoredDependency>io.opentelemetry:opentelemetry-api</ignoredDependency>\n <ignoredDependency>io.opentelemetry:opentelemetry-context</ignoredDependency>\n <ignoredDependency>io.opentelemetry:opentelemetry-common</ignoredDependency>\n <ignoredDependency>io.opentelemetry:opentelemetry-sdk</ignoredDependency>\n <ignoredDependency>io.opentelemetry:opentelemetry-sdk-common</ignoredDependency>\n <ignoredDependency>io.opentelemetry:opentelemetry-sdk-metrics</ignoredDependency>\n <ignoredDependency>io.opentelemetry:opentelemetry-sdk-trace</ignoredDependency>\n <ignoredDependency>io.opentelemetry:opentelemetry-sdk-logs</ignoredDependency>\n <ignoredDependency>io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi</ignoredDependency>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the googleapis/java-bigtable-hbase API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant