Track vulnerabilities like this one. Sign up free to get alerted when software you use is affected.

Gradle daemon can execute code from crafted input

published 6 days ago
Summary

The Gradle build tool’s background process (daemon) can run malicious code if an attacker can inject data into the local connection it uses. This risk affects Gradle 8 and 9 images and related WireMock images that run the daemon. Update to the latest Gradle version that validates the secret token before processing data to eliminate the risk.

What to do

The CVE record does not list a fixed version. Check the vendor's site or the advisory links below - a fix may already be released.

Affected software
Ecosystem VendorProductAffected versions
Docker Hardened Images:Alpine:3.23 docker hardened images gradle-8 All versions
Docker Hardened Images:Alpine:3.23 docker hardened images gradle-9 All versions
Docker Hardened Images:Debian:13 docker hardened images wiremock-gui All versions
Docker Hardened Images:Debian:13 docker hardened images wiremock All versions
Original advisory text
### Impact
### Impact

A **Gradle client** (the `gradle`/`gradlew` CLI or an IDE using the Tooling API) connects to a long-lived **Gradle daemon** over a loopback TCP connection to send build commands. The daemon listens on this port for its entire lifetime. Most commands on that channel are typed and use a custom serializer but messages can request to use Java serialization. The daemon authenticates client commands with a secret token, but it deserializes the incoming message before it verifies that token. This advisory is about a vulnerability on this communication channel.

An attacker who can place bytes on this channel can cause the daemon to deserialize a hostile object graph which can lead to remote code execution in the daemon JVM or a denial of service (a crash or resource exhaustion from a malformed or deeply nested graph). This has been demonstrated with a proof-of-concept. Code execution in the daemon runs with the privileges of the user running the build and exposes in-memory and on-disk secrets available to it. This advisory does not publish the proof-of-concept.

Builds running on **shared / multi-user build hosts** are the most at risk. The vulnerability requires a Gradle daemon to be running and it does not need to be actively building.

This vulnerability is not exploitable from a remote network connection.

### Patches

Gradle has updated the daemon protocol to verify the secret token before deserializing untrusted input.

| Fix version | Availability |
| ---------- | ----------- |
| 9.8.1 | OSS |
| 9.7.2 | [Gradle Security Subscription](https://gradle.org/security-subscription/) |
| 9.6.2 | [Gradle Security Subscription](https://gradle.org/security-subscription/) |
| 9.5.2 | [Gradle Security Subscription](https://gradle.org/security-subscription/) |
| 9.4.2 | [Gradle Security Subscription](https://gradle.org/security-subscription/) |
| 9.3.2 | [Gradle Security Subscription](https://gradle.org/security-subscription/) |
| 9.2.2 | [Gradle Security Subscription](https://gradle.org/security-subscription/) |
| 9.1.2 | [Gradle Security Subscription](https://gradle.org/security-subscription/) |
| 8.14.6 | OSS |
| 7.6.7 | [Gradle Security Subscription](https://gradle.org/security-subscription/) |

### Workarounds

Upgrading Gradle is our recommended fix.

If you cannot upgrade immediately:

* **Do not run builds on shared, multi-user machines.** Ensure only trusted users have local (same-host) access to a machine while a Gradle build/daemon is running. On CI, prefer single-tenant, ephemeral runners rather than shared hosts. The attacker must be a co-located local principal to gain access to the Gradle build.

If you cannot apply these mitigations, restrict which users and processes share a host with your builds until you can upgrade.

### Forensics

The Gradle daemon logs at warning level any message it fails to process. See below for how the log line looks like, it would be usually followed by an exception and a stack trace:

`Unable to receive command from client socket connection from /127.0.0.1:<port> to /127.0.0.1:<port>. Discarding connection.`

If a build was running during this connection attempt, this line will be visible in the build logs as well. If no build was running, then this line will only be visible in daemon logs, prefixed with a timestamp, log level and log origin, such as:

`2026-01-01T12:00:00.000+0000 [WARN] [org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler]`

Documentation about daemon logs can be found [here](https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:daemon_logs).

> [!IMPORTANT]
> The lack of a log entry cannot be used to conclude no such attack was performed. The presence of a log entry is not a confirmation that an attack happened, but an indication that more investigations are needed.

### References

* [Gradle architecture standard ADR-0002](https://github.com/gradle/gradle/blob/master/architecture/standards/0002-avoid-using-java-serialization.md), "Avoid using Java serialization" — Gradle's own guidance to move off Java serialization, citing deserialization security among the reasons.
* [JEP 290: Filter Incoming Serialization Data](https://openjdk.org/jeps/290)
* [Unauthenticated worker-to-daemon channel deserializes untrusted Java objects](https://github.com/gradle/gradle/security/advisories/GHSA-mvvg-497x-hmj8)

More about this type of vulnerabilities:

* https://cwe.mitre.org/data/definitions/306.html
* https://cwe.mitre.org/data/definitions/502.html
Timeline
Published20 Nov 2026
Updated20 Nov 2026
First seen20 Nov 2026
Sources
Track software like this
Free during beta