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.
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 |
| 9.6.2 | Gradle Security Subscription |
| 9.5.2 | Gradle Security Subscription |
| 9.4.2 | Gradle Security Subscription |
| 9.3.2 | Gradle Security Subscription |
| 9.2.2 | Gradle Security Subscription |
| 9.1.2 | Gradle Security Subscription |
| 8.14.6 | OSS |
| 7.6.7 | Gradle Security Subscription |
Upgrading Gradle is our recommended fix.
If you cannot upgrade immediately:
If you cannot apply these mitigations, restrict which users and processes share a host with your builds until you can upgrade.
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.
[!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.
More about this type of vulnerabilities:
{
"coverage": "partial",
"coverage_exclusions": [
"legacy_package_image_owner"
]
}