CVE-2026-22816
JSON

8.6high

Gradle fails to disable repositories which can expose builds to malicious artifacts

Severity
8.6high CVSS:4.0 by GitHub_M
Exploit likelihood
0.23% (higher than 14% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-w78c-w6vf-rw82BIT-GRADLE-2026-22816

Description

Gradle is a build automation tool, and its native-platform tool provides Java bindings for native APIs. When resolving dependencies in versions before 9.3.0, some exceptions were not treated as fatal errors and would not cause a repository to be disabled. If a build encountered one of these exceptions, Gradle would continue to the next repository in the list and potentially resolve dependencies from a different repository. If a Gradle build used an unresolvable host name, Gradle would continue to work as long as all dependencies could be resolved from another repository. An unresolvable host name could be caused by allowing a repository's domain name registration to lapse or typo-ing the real domain name. This behavior could allow an attacker to register a service under the host name used by the build and serve malicious artifacts. The attack requires the repository to be listed before others in the build configuration. Gradle has introduced a change in behavior in Gradle 9.3.0 to stop searching other repositories when encountering these errors.

Affected

Product or packageVersionsReported by
gradle gradle< 9.3.0, before 8.14.4, from 9.0.0 before 9.3.0CVE List, NVD
org.gradle:gradle-core (Maven)before 8.14.4, from 9.0.0 before 9.3.0GitHub Advisory Database
gradle (Bitnami)before 9.3.0Bitnami Vulnerability Database

All scores

GitHub_M8.6high CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:H/SA:N
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:H/SA:N
NVD7.4high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
Bitnami Vulnerability Databasehigh rating

Classification

CWE-494CWE-829

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Gradle is a build automation tool, and its native-platform tool provides Java bindings for native APIs. When resolving dependencies in versions before 9.3.0, some exceptions were not treated as fatal errors and would not cause a repository to be disabled. If a build encountered one of these exceptions, Gradle would continue to the next repository in the list and potentially resolve dependencies from a different repository. If a Gradle build used an unresolvable host name, Gradle would continue to work as long as all dependencies could be resolved from another repository. An unresolvable host name could be caused by allowing a repository's domain name registration to lapse or typo-ing the real domain name. This behavior could allow an attacker to register a service under the host name used by the build and serve malicious artifacts. The attack requires the repository to be listed before others in the build configuration. Gradle has introduced a change in behavior in Gradle 9.3.0 to stop searching other repositories when encountering these errors.

GitHub Advisory Database
Impact

When resolving dependencies, Gradle searches repositories in declaration order. If it encounters connection errors, Gradle will disable the repository and fail dependency resolution. This is necessary for both reproducibility and security reasons to prevent dependencies from being resolved from other repositories without warning.

In previous versions of Gradle, some exceptions were not treated as fatal errors and would not cause a repository to be disabled. If a build encountered one of these exceptions, Gradle would continue to the next repository in the list and potentially resolve dependencies from a different repository.

Vulnerability caused by unresolvable host names

UnknownHostException are caused when a host name cannot be resolved to an IP address. This can be caused by DNS misconfiguration, host name typos or any problem that prevents host name resolution.

If a Gradle build used an unresolvable host name, Gradle would continue to work as long as all dependencies could be resolved from another repository. An unresolvable host name could be caused by allowing a repository's domain name registration to lapse or typo-ing the real domain name.

This behavior could allow an attacker to register a service under the host name used by the build and serve malicious artifacts. The attack requires the repository to be listed before others in the build configuration.

Patches

Gradle has introduced a change in behavior in Gradle 9.3.0 and 8.14.4 to stop searching other repositories when encountering these errors.

Upgrading to either version will protect you against the vulnerabilities described here.

Workarounds

If you are using strict repository content filtering and / or dependency verification, your build is safe from the potential vulnerabilities described above.

If you cannot update to a newer Gradle version, configuring dependency verification is the best way to make sure your build resolves the dependencies you expect and nothing else.

You should also review which repositories your builds use to check for unused or outdated repository declarations.

Related
NVD (es)

Gradle es una herramienta de automatización de compilaciones, y su herramienta de plataforma nativa proporciona enlaces Java para APIs nativas. Al resolver dependencias en versiones anteriores a la 9.3.0, algunas excepciones no eran tratadas como errores fatales y no causarían la desactivación de un repositorio. Si una compilación encontraba una de estas excepciones, Gradle continuaría con el siguiente repositorio en la lista y potencialmente resolvería dependencias de un repositorio diferente. Si una compilación de Gradle utilizaba un nombre de host irresoluble, Gradle seguiría funcionando siempre y cuando todas las dependencias pudieran resolverse desde otro repositorio. Un nombre de host irresoluble podría ser causado por permitir que el registro del nombre de dominio de un repositorio caduque o por escribir mal el nombre de dominio real. Este comportamiento podría permitir a un atacante registrar un servicio bajo el nombre de host utilizado por la compilación y servir artefactos maliciosos. El ataque requiere que el repositorio esté listado antes que otros en la configuración de la compilación. Gradle ha introducido un cambio en el comportamiento en Gradle 9.3.0 para dejar de buscar otros repositorios al encontrar estos errores.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-22816 changed 2026-01-20CVE Terms of Use
GitHub Advisory DatabaseGHSA-w78c-w6vf-rw82 changed 2026-11-23CC-BY-4.0
NVDCVE-2026-22816 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-GRADLE-2026-22816 changed 2026-09-08Apache-2.0