Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

AWS JDBC Wrapper: code execution via the cache, upgrade to 4.3.0 or later

Table of contents · 7 items

When connecting a Java application to Amazon Aurora or RDS, some setups wrap the standard JDBC driver with the AWS Advanced JDBC Wrapper to use AWS features such as failover handling and caching. If the "Remote Query Cache Plugin" added in version 3.3.0 of this Wrapper is enabled, anyone who can write to the cache server could run arbitrary code on the application server.

This issue (GHSA-c5q4-97jw-jggh, CVE-2026-14265, HIGH) was disclosed on July 1, 2026, in an AWS security bulletin and a repository advisory. It affects versions 3.3.0 and later but earlier than 4.0.1, and the fixed version 4.0.1 was released on Maven Central on May 13. It was added to the GitHub Advisory Database as reviewed on November 17. GitHub's documentation says, "If you enable Dependabot alerts for your repositories, you are automatically notified when a new GitHub-reviewed advisory reports a vulnerability for a package you depend on." So even if a Dependabot alert first appeared on or after November 17, the issue itself had been known since July.

The same plugin also has a separate issue disclosed on September 11, 2026 (GHSA-fpvp-qwgm-v6h9, CVE-2026-18061, MEDIUM). When reading XML values stored in the cache, it loads external files and other resources specified inside the XML (XXE, XML external entities). It affects versions 3.3.0 through 4.2.0 and is fixed in 4.3.0. As of November 24, 2026, this one is not in the GitHub Advisory Database. Upgrading only to 4.0.1 leaves you affected by it.

In this article, we use the AWS bulletins, advisories, changelog, fix commits and plugin documentation to lay out when you are affected and what may change after updating.

You are affected only if the plugin is enabled

The Remote Query Cache Plugin stores the results of read queries that have a hint such as /* CACHE_PARAM(ttl=300s) */ at the start of the SQL in Valkey (a Redis-compatible cache), and returns the next identical query from the cache without sending it to the database. The documentation says, "The plugin is available since version 3.3.0." It is not loaded by default. It runs only when you add remoteQueryCache to wrapperPlugins in the connection settings and specify the cache server with cacheEndpointAddrRw.

In other words, even if you use the Wrapper, these two issues do not affect you unless this plugin is enabled. The first step is to check the connection settings (wrapperPlugins).

What happened

The plugin converts query results into a byte sequence using Java serialization, stores it in the cache, and turns it back into the original objects when reading. According to the advisory, this restoring step (deserialization) accepted any class.

query results read from the shared Redis/Valkey cache are deserialized without class filtering. An actor with write access to the shared cache infrastructure could insert a crafted serialized Java object that, when read by an application, results in execution of arbitrary code on the application server.

Java deserialization is known to run code when fed a crafted byte sequence, through combinations of libraries on the classpath (gadget chains). The NVD description also says "enabling gadget chain execution when cache entries are poisoned." The condition here is "being able to write to the cache." In setups where the cache server is shared by multiple applications, accepts connections without authentication, or is reachable from other internal servers, the application is not necessarily the only thing that can write to the cache. Even someone without database privileges could run code on the application server if they can write to the cache.

How code runs on the application server via the cache in the Remote Query Cache Plugin of the AWS Advanced JDBC Wrapper. Before 4.0.1, query results read from Valkey were deserialized regardless of class, so a crafted object placed by anyone who could write to the cache was executed on the application server. From 4.0.1, only allowed classes are restored, and anything else is treated as a cache miss and queried from the database

What changes in 4.0.1

The 4.0.1 changelog says, "Added allowlist classes for CacheResultSet deserialization to prevent unsafe Java deserialization." The fix commit (d6b79c6, May 12) uses a dedicated class (SafeObjectInputStream) for deserialization and limits which classes may be restored. Allowed are the plugin's own classes, fixed types such as String and UUID, standard types such as numbers, dates, times and collections, and classes and packages registered by the user.

After updating, watch out for results that contain types that are not allowed. For example, if you cache queries whose results include PostgreSQL's PGvector (a vector type) or PostGIS types, those results can no longer be restored after the update. In the code, when a result cannot be restored, a warning ("Error de-serializing cached result.") is logged and the query is sent to the database as a cache miss. The application does not stop, but the cache stops working and the load on the database comes back.

The documentation advises registering such types with Driver.skipWrappingForType() or Driver.skipWrappingForPackage(). At the same time, because registered classes are also allowed during deserialization, it asks that you limit them to ones without a dangerous readObject() ("ensure that any registered classes have safe deserialization behavior and cannot be used as part of a gadget chain attack").

Note that 4.0.0 includes breaking changes for users who build their own plugins (such as removing the HostSpec alias). The changelog says that when upgrading from 3.3.x to 4.x, no configuration changes are needed if you have no custom plugins. In the changelogs from 3.3.0 to 4.7.0, only 4.0.0 has a "Breaking Changes" section.

The September XXE and what changes in 4.3.0

According to the September 11 bulletin (CVE-2026-18061), XML values read from the cache were parsed with a parser that did not disable DTDs or external entities. The advisory describes it as follows.

When an application subsequently reads that entry as XML, for example by calling getSQLXML().getSource() on a cached result, the parser resolves the external entities defined in the payload, which could disclose sensitive files readable by the application process, including stored database and IAM role credentials.

As with the other issue, the condition is "the plugin is enabled and someone can write to the cache," plus the application reading cached results as XML. Files the application process can read may be exposed, and the advisory also lists database and IAM role credentials.

The advisory gives only the fixed version (4.3.0, July 23) and does not list a commit. Among the changes from 4.2.0 to 4.3.0, the one that changed XML parsing is PR #2034. This PR disabled DTDs and external entities in XML parsing and also narrowed the deserialization allowlist further. From this version, the following two can no longer be used by default.

  • Cached XML SQLXML.getSource(StreamSource.class). The documentation explains that it becomes SQLException. If needed, you can restore the previous behavior with cacheAllowStreamSource=true, but the receiving side then takes responsibility for parsing it safely.
  • Restoring java.net.URL values from the cache. The documentation recommends using java.net.URI and advises setting cacheAllowUrl=true only when it is truly necessary.

Both AWS bulletins say, "We recommend upgrading to the latest version." As of November 24, the latest is 4.7.0 (November 19). Note that from 4.6.0, cache hints that are not at the start of a query are ignored and the query is not cached. If you upgrade from 4.0.1 to the latest version, check this change as well.

Steps to check (editorial suggestion)

  1. Check whether the plugin is in use. In the connection settings (for Spring Boot, the connection properties in application.yml, or Properties in code), see whether wrapperPlugins contains remoteQueryCache. If not, you are not affected this time.
  2. Check the version. Look for software.amazon.jdbc:aws-advanced-jdbc-wrapper in the output of mvn dependency:tree for Maven or dependencies for Gradle. If it is 3.3.0 or later but earlier than 4.3.0, you need to update (4.0.1 through 4.2.0 are also affected by the XXE).
  3. If you cannot upgrade right away. The workarounds in the two advisories are the same: disable the plugin, and restrict writes to the cache server to trusted principals. The 4.7.0 documentation also says, "Anyone who can connect to the cache cluster can read and overwrite every cached result." and "Protect the cache cluster as you would the database." If you use ElastiCache, check with security groups and per-user access control (or IAM authentication) that only the application can write.
  4. Check logs and hit rates after updating. In a test environment, run queries with cache hints and confirm that "Error de-serializing cached result." does not appear, and that the cache hit rate and the number of database queries are unchanged from before the update. If the warning appears, check the types included in the results and register only safe ones. Also check whether code that reads XML columns with StreamSource, or queries that cache java.net.URL values, are affected by the changes from 4.3.0.
  5. Decide whether to clear the cache. Crafted objects or XML written before the update are not restored or parsed by the fixed version, but they remain in the cache. Clearing it once, either by deleting keys by the prefix the documentation describes (cacheKeyPrefix) or with FLUSHALL, makes it easier to tell these apart from warnings in the logs.

Scope of verification

On November 22–24, 2026, we reviewed the AWS security bulletins (2026-051-AWS, 2026-109-AWS), the repository advisories (GHSA-c5q4-97jw-jggh, GHSA-fpvp-qwgm-v6h9) and their listing status in the GitHub Advisory Database, the two NVD descriptions, the diff of commit d6b79c6 and the description of PR #2034, CHANGELOG.md in v4.0.1 and v4.7.0, the relevant code in UsingTheRemoteQueryCachePlugin.md, UsingTheJdbcDriver.md and RemoteQueryCachePlugin.java, and the versions and release dates on Maven Central (document research). We did not build an application, reproduce the issue or check behavior after updating ourselves.

We covered Valkey's role as a caching platform in our Valkey article, and reviewing business systems that use Aurora in our Aurora Serverless v4 article.

GleamHub's development, AI and automation consulting covers maintaining business systems running on AWS and planning dependency updates. Please reach out through our contact form.

References

Share this articleXFacebook
Kakeru Suzuki

Fascinated by the possibilities of technology, has had a deep interest in programming and digital art since student days

Turn this article's theme into your company's next step

Concrete steps forward for your organization.

We organize your desired architecture, legacy systems, and operational requirements to formulate your next steps toward execution.

  • Desired architecture
  • Integration with existing environments
  • Operational requirements
Consult on development & operations initiatives

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles by email