8.6high
Gradle's failure to disable repositories failing to answer can expose builds to malicious artifacts
- Severity
- 8.6high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.21% (higher than 7% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-mqwm-5m85-gmcvBIT-GRADLE-2026-22865
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. An exception like NoHttpResponseException can indicate transient errors. If the errors persist after a maximum number of retries, Gradle would continue to the next repository. This behavior could allow an attacker to disrupt the service of a repository and leverage another repository to serve malicious artifacts. This attack requires the attacker to have control over a repository after the disrupted repository. Gradle has introduced a change in behavior in Gradle 9.3.0 to stop searching other repositories when encountering these errors.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| gradle gradle | < 9.3.0, before 8.14.4, from 9.0.0 before 9.3.0 | CVE List, NVD |
| org.gradle:gradle-core (Maven) | before 8.14.4, from 9.0.0 before 9.3.0 | GitHub Advisory Database |
| gradle (Bitnami) | before 9.3.0 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 8.6high CVSS:4.0 | CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:H/SA:N |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:H/SA:N |
| NVD | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N |
| Bitnami Vulnerability Database | high rating |
Classification
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. An exception like NoHttpResponseException can indicate transient errors. If the errors persist after a maximum number of retries, Gradle would continue to the next repository. This behavior could allow an attacker to disrupt the service of a repository and leverage another repository to serve malicious artifacts. This attack requires the attacker to have control over a repository after the disrupted repository. 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 continuing after max retries on transient errors
An exception like NoHttpResponseException can indicate transient errors. If the errors persist after a maximum number of retries, Gradle would continue to the next repository.
This behavior could allow an attacker to disrupt the service of a repository and leverage another repository to serve malicious artifacts. This attack requires the attacker to have control over a repository after the disrupted repository.
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 compilación, 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 se trataban como errores fatales y no causarían la deshabilitación de un repositorio. Si una compilación encontraba una de estas excepciones, Gradle continuaría con el siguiente repositorio de la lista y potencialmente resolvería dependencias de un repositorio diferente. Una excepción como NoHttpResponseException puede indicar errores transitorios. Si los errores persisten después de un número máximo de reintentos, Gradle continuaría con el siguiente repositorio. Este comportamiento podría permitir a un atacante interrumpir el servicio de un repositorio y aprovechar otro repositorio para servir artefactos maliciosos. Este ataque requiere que el atacante tenga control sobre un repositorio después del repositorio interrumpido. Gradle ha introducido un cambio de comportamiento en Gradle 9.3.0 para dejar de buscar en otros repositorios al encontrar estos errores.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-22865 changed 2026-01-20 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-mqwm-5m85-gmcv changed 2026-11-23 | CC-BY-4.0 |
| NVD | CVE-2026-22865 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-GRADLE-2026-22865 changed 2026-09-08 | Apache-2.0 |