PT-2026-162528
Published
2026-11-20
·
Updated
2026-11-20
Description by
Score
N/A
Not availableNo severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.
Impact
A Gradle client (the
gradle/gradlew CLI or an IDE using the Tooling API) looks up running Gradle daemons in a registry file under the Gradle user home, then connects to an idle daemon over a loopback TCP connection and sends it the build to run. The client authenticates itself to the daemon with a secret token, but the daemon is not authenticated to the client, and the client does not check that the daemon process recorded in the registry is still running. This advisory is about a vulnerability on this communication channel.When a daemon terminates without removing itself from the registry, for example when it is killed with
kill -9, stopped by the out-of-memory killer or crashes, its loopback port becomes free while the registry still points to it. Another local user who binds that port receives the next build request from the victim's client. That request contains the client's environment variables, system properties and standard input, which commonly hold credentials and CI tokens. The attacker can then answer with crafted messages that the client deserializes:- in an IDE or any other Tooling API client, a crafted reply makes the client process load and run code from a jar chosen by the attacker;
- on the command line, deserializing a hostile object graph can lead to code execution in the client, depending on the classes available, or to a denial of service.
Code execution in the client runs with the privileges of the user running the build. This has been demonstrated with a proof-of-concept. 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 daemon to have terminated abnormally, leaving a stale entry in the registry, and the attacker to listen on that daemon's port when the victim next starts a build or synchronizes a project in an IDE.
This vulnerability is not exploitable from a remote network connection.
Patches
The client and the daemon now authenticate each other as soon as a connection opens, before any message is exchanged. The connection token in the registry holds two secrets. The client proves it holds the first one, and only then does the daemon answer with the second. The client checks that answer before it sends anything else. A process listening on the port of a terminated daemon cannot produce the daemon's secret. The client therefore drops the connection, removes the stale entry from the registry, and uses or starts another daemon. That process only receives the client's half of the token of a daemon that no longer exists.
The fix depends on the Gradle version used by the build, not on the Tooling API version of the IDE.
| Fix version | Availability |
|---|---|
| 9.9.1 | OSS |
| 9.8.3 | Gradle Security Subscription |
| 9.7.3 | Gradle Security Subscription |
| 9.6.3 | Gradle Security Subscription |
| 9.5.3 | Gradle Security Subscription |
| 9.4.3 | Gradle Security Subscription |
| 9.3.3 | Gradle Security Subscription |
| 9.2.3 | Gradle Security Subscription |
| 8.14.7 | OSS |
| 7.6.8 | Gradle 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 where Gradle builds run. 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.
- Clear the daemon registry after a daemon terminated abnormally, before the next build. Delete
<Gradle user home>/daemon/<Gradle version>/registry.bin. This is safe while daemons are running. Clients no longer find the running daemons and start new ones, and the unregistered daemons stop after their idle timeout (3 hours by default). On an affected version, do not usegradle --statusorgradle --stopfor this: both connect to every daemon in the registry, including stale entries.
If you cannot apply these mitigations, restrict which users and processes share a host with your builds until you can upgrade.
Forensics
Gradle's output does not tell a process squatting a daemon's port apart from a daemon whose port is free. Look for the conditions of the attack on the build host instead:
- A daemon that terminated abnormally leaves a log file,
<Gradle user home>/daemon/<Gradle version>/daemon-<pid>.out.log, that does not end withDaemon vm is shutting down...even though process<pid>is no longer running. Its port is on the lineDaemon starting at: …, with address: [… port:<port>, …]. - A process of another user listening on that port indicates an attempt. On Linux and macOS:
lsof -nP -iTCP:<port> -sTCP:LISTEN.
[!IMPORTANT] These checks reveal the conditions for the attack, not the attack itself: by default, Gradle does not record which process a client sent its request to. Daemons also terminate abnormally for ordinary reasons, such as the out-of-memory killer, a crash or a machine reboot, so a log file without a shutdown line is not evidence of an attack. A squatting process only shows while it is still listening, and Gradle deletes daemon log files after 14 days by default, so finding neither does not rule out an attack.
References
- Deserialization of untrusted Java objects before authentication in the client - daemon communication
- Project-controlled daemon registry location
- Gradle architecture standard ADR-0002, "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
More about this type of vulnerabilities:
Vendors
Affected products
Related identifiers
Found an issue in the description? Have something to add? Feel free to write us 👾