PT-2026-162526
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) finds running Gradle daemons through a registry file, which records the address of each daemon and the secret token used to connect to it. By default the registry is in the Gradle user home, and the org.gradle.daemon.registry.base property changes its location. This advisory is about a vulnerability in how the client reads and uses this registry.The
org.gradle.daemon.registry.base property is honoured when it is set in a project's gradle.properties, so a project can make the client read a registry file that the project itself ships. The client trusts the content of that file:- it deserializes parts of the file with Java serialization;
- it connects to any address listed in the file, including a remote host, although daemons only ever listen locally;
- it sends its request to that address, including the client's environment variables and system properties for a build, and deserializes the replies, also with Java serialization.
When the client is an IDE or another tool using the Tooling API, a crafted reply makes the client load and run code from a jar URL chosen by the attacker, with the privileges of the user.
A project that sets
org.gradle.daemon.registry.base is not a safe setup: the property makes the client use daemons, and send them its environment, through a file the project chooses, before any build logic runs. Like a project-set systemProp.gradle.user.home, it has to be checked before running Gradle on an untrusted project. Gradle did not document it as such, so users who relied on a validated Wrapper for commands that run no build logic, such as gradle --status and gradle --stop, or on a review of the build scripts before an IDE synchronizes the project, could run code that appears in none of the project's reviewable sources.Users who open or inspect untrusted repositories, for example pull requests from forks, are the most at risk.
The attacker must get the user to clone the malicious repository, then run Gradle on it or open it in an IDE.
Patches
The fixed versions harden how the client reads and uses the daemon registry. They do not make a registry location set by a project safe.
The client no longer uses Java serialization to read the daemon registry. It accepts only the address types Gradle itself writes, and fails on anything else. It also connects only to addresses of the local machine and skips any other address listed in the registry. Together with the mutual authentication of the connection that fixes GHSA-pcp8-98xm-c6pr, this means a local process that is not a Gradle daemon no longer receives the client's request.
org.gradle.daemon.registry.base is still honoured in a project's gradle.properties, and a local process holding a token from a registry the project ships still receives the client's request. Check for this property before running Gradle on an untrusted project, also with a fixed version, as described under Workarounds.| 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 reduces the impact, but does not make a project that sets
org.gradle.daemon.registry.base safe. With any Gradle version, before running any Gradle command on an untrusted repository or opening it in an IDE:- Check the project's
gradle.propertiesfororg.gradle.daemon.registry.base. A project has no reason to set it; do not run Gradle on a project that does. - Check that no daemon registry is committed.
git ls-files | grep 'registry.bin$'lists committed registry files.
Forensics
A repository that exploits this vulnerability sets
org.gradle.daemon.registry.base in gradle.properties and contains a registry.bin file. To check a repository's history, including removed files:git log --all -p -- '*gradle.properties' | grep 'org.gradle.daemon.registry.base'
git log --all --name-only --format= | grep 'registry.bin$'
A fixed version reports a crafted registry instead of using it:
- An entry with an address type Gradle does not write fails the command with
Could not read cache value from '<path>/registry.bin'., caused byUnexpected address type <n> in the daemon registry. - An entry with an address of another machine is skipped. With
--info, the client logsRemoving daemon from the registry due to communication failure. Daemon information: …. With--debug, it also logsAddress <address> is not an address of this machine, skipping.
[!IMPORTANT] The lack of such files in a repository cannot be used to conclude no such attack was performed. Their presence is not a confirmation that an attack happened, but an indication that more investigations are needed.
References
- Deserialization of untrusted Java objects before authentication in the client - daemon communication
- Daemon client trusts stale registry entries (port squatting)
- 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 👾