{"id":"CVE-2026-22816","aliases":["CVE-2026-22816","GHSA-w78c-w6vf-rw82","BIT-GRADLE-2026-22816"],"related":[],"kind":"vulnerability","state":"published","title":"Gradle fails to disable repositories which can expose builds to malicious artifacts","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nWhen 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. \n\nIn 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. \n\n#### Vulnerability caused by unresolvable host names\n\n[`UnknownHostException`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/net/UnknownHostException.html) 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. \n\nIf 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. \n\nThis 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. \n\n### Patches\n\nGradle has introduced a change in behavior in Gradle 9.3.0 and 8.14.4 to stop searching other repositories when encountering these errors. \n\nUpgrading to either version will protect you against the vulnerabilities described here.\n\n### Workarounds\n\nIf you are using strict [repository content filtering](https://docs.gradle.org/9.3.0/userguide/filtering_repository_content.html#header) and / or [dependency verification](https://docs.gradle.org/9.3.0/userguide/dependency_verification.html), your build is safe from the potential vulnerabilities described above.\n\nIf you cannot update to a newer Gradle version, configuring [dependency verification](https://docs.gradle.org/9.3.0/userguide/dependency_verification.html) is the best way to make sure your build resolves the dependencies you expect and nothing else.\n\nYou should also review which repositories your builds use to check for unused or outdated repository declarations. \n\n### Related\n* [Security feature of failing fast on bad repos does not seem to be implemented](https://github.com/gradle/gradle/issues/35927)\n* [Repository disabling](https://docs.gradle.org/current/userguide/graph_resolution.html#sec:repository-disabling)\n* [Advisory about repositories failing to answer](https://github.com/gradle/gradle/security/advisories/GHSA-mqwm-5m85-gmcv)","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-01-16T22:45:48.937Z","modified":"2026-11-23T15:45:04.066Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.6,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N","score":7.4,"rating":"HIGH"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-494","CWE-829"],"affected":[{"ranges":[{"version":"< 9.3.0","status":"affected"}],"vendor":"gradle","product":"gradle","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"8.14.4"}],"ecosystem":"Maven","package":"org.gradle:gradle-core","purl":"pkg:maven/org.gradle/gradle-core","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"9.0.0","status":"affected","fixed":"9.3.0"}],"ecosystem":"Maven","package":"org.gradle:gradle-core","purl":"pkg:maven/org.gradle/gradle-core","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"8.14.4"},{"status":"affected","introduced":"9.0.0","fixed":"9.3.0"}],"vendor":"gradle","product":"gradle","cpe":"cpe:2.3:a:gradle:gradle:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"9.3.0"}],"ecosystem":"Bitnami","package":"gradle","purl":"pkg:bitnami/gradle","source":"bitnami"}],"references":[{"url":"https://github.com/gradle/gradle/security/advisories/GHSA-w78c-w6vf-rw82","tags":["advisory","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://github.com/gradle/gradle/commit/e5707d0d8fce3d768c9c489004700d78eab1773a","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22816","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/gradle/gradle/commit/4f2e3bbee4d0cee307dd97b684f11cfbe711b6f3","tags":["web"],"sources":["ghsa"]},{"url":"https://docs.gradle.org/8.14.4/release-notes.html","tags":["web"],"sources":["ghsa"]},{"url":"https://docs.gradle.org/9.3.0/release-notes.html","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/gradle/gradle","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/gradle/gradle/releases/tag/v8.14.4","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/gradle/gradle/releases/tag/v9.3.0","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-01-20T14:49:03.938Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-22816","url":"https://www.cve.org/CVERecord?id=CVE-2026-22816","licence":"CVE Terms of Use","modified":"2026-01-20T14:49:32.077Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-w78c-w6vf-rw82","url":"https://github.com/advisories/GHSA-w78c-w6vf-rw82","licence":"CC-BY-4.0","modified":"2026-11-23T15:45:04.066Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-22816","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22816","licence":"Public domain","modified":"2026-06-17T10:20:28.837Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-GRADLE-2026-22816","url":"https://osv.dev/vulnerability/BIT-GRADLE-2026-22816","licence":"Apache-2.0","modified":"2026-09-08T08:47:50.752Z"}],"updatedAt":"2026-11-25T22:59:12.903Z","epss":{"score":0.0023,"percentile":0.14762,"date":"2026-12-01T12:00:22.000Z"}}