{"id":"GHSA-mqwm-5m85-gmcv","summary":"Gradle causes failure to disable repositories exposing builds to malicious artifacts","details":"### 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 continuing after max retries on transient errors\n\nAn exception like [`NoHttpResponseException`](https://hc.apache.org/httpclient-legacy/exception-handling.html#org_apache_commons_httpclient_NoHttpResponseException) can indicate transient errors. If the errors persist after a maximum number of retries, Gradle would continue to the next repository. \n\nThis 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.\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 with unknown host](https://github.com/gradle/gradle/security/advisories/GHSA-w78c-w6vf-rw82)","aliases":["BIT-gradle-2026-22865","CVE-2026-22865"],"modified":"2026-11-23T16:00:04.252779119Z","published":"2026-11-23T15:41:57Z","database_specific":{"nvd_published_at":"2026-01-16T23:15:50Z","cwe_ids":["CWE-494","CWE-829"],"severity":"HIGH","github_reviewed":true,"github_reviewed_at":"2026-11-23T15:41:57Z"},"references":[{"type":"WEB","url":"https://github.com/gradle/gradle/security/advisories/GHSA-mqwm-5m85-gmcv"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22865"},{"type":"WEB","url":"https://github.com/gradle/gradle/commit/d38bfc0f1d4dabd38b305a67489bb8a6645138a1"},{"type":"WEB","url":"https://github.com/gradle/gradle/commit/fa96c8bc7f7741e5dfa1da002c559afca3fa1fc1"},{"type":"WEB","url":"https://docs.gradle.org/8.14.4/release-notes.html"},{"type":"WEB","url":"https://docs.gradle.org/9.3.0/release-notes.html"},{"type":"PACKAGE","url":"https://github.com/gradle/gradle"},{"type":"WEB","url":"https://github.com/gradle/gradle/releases/tag/v8.14.4"},{"type":"WEB","url":"https://github.com/gradle/gradle/releases/tag/v9.3.0"}],"affected":[{"package":{"name":"org.gradle:gradle-core","ecosystem":"Maven","purl":"pkg:maven/org.gradle/gradle-core"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"8.14.4"}]}],"versions":["0.8","0.9","0.9.1","0.9.2","1.0","1.1","1.10","1.11","1.12","1.2","1.3","1.4","1.5","1.6","1.7","1.8","1.9","2.0","2.1","2.10","2.11","2.12","2.13","2.14","2.14.1","2.2","2.2.1","2.3","2.4","2.5","2.6","2.7","2.8","2.9","3.0","3.1","3.2","3.2.1","3.3","3.4","3.4.1","3.5","3.5.1","4.0","4.0.1","4.0.2","4.1","4.10","4.10.1","4.10.2","4.10.3","4.2","4.2.1","4.3","4.3.1","4.4","4.4.1","4.5","4.5.1","4.6","4.7","4.8","4.8.1","4.9","5.0","5.1","5.1.1","5.2","5.2.1","5.3","5.3.1","5.4","5.4.1","5.5","5.5.1","5.6","5.6.1","5.6.2","5.6.3","5.6.4","6.0","6.0.1","6.1","6.1.1","6.2","6.2.1","6.2.2","6.3","6.4","6.4.1","6.5","6.5.1","6.6","6.6.1","6.7","6.7.1","6.8","6.8.1","6.8.2","6.8.3","6.9","6.9.1","6.9.2","6.9.3","6.9.4","7.0","7.0.1","7.0.2","7.1","7.1.1","7.2","7.3","7.3.1","7.3.2","7.3.3","7.4","7.4.1","7.4.2","7.5","7.5.1","7.6","7.6.1","7.6.2","7.6.3","7.6.4","7.6.5","7.6.6","8.0","8.0.1","8.0.2","8.1","8.1.1","8.10","8.10.1","8.10.2","8.11","8.11.1","8.12","8.12.1","8.13","8.14","8.14.1","8.14.2","8.14.3","8.2","8.2.1","8.3","8.4","8.5","8.6","8.7","8.8","8.9"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-mqwm-5m85-gmcv/GHSA-mqwm-5m85-gmcv.json"}},{"package":{"name":"org.gradle:gradle-core","ecosystem":"Maven","purl":"pkg:maven/org.gradle/gradle-core"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"9.0.0"},{"fixed":"9.3.0"}]}],"versions":["9.0.0","9.1.0","9.2.0","9.2.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-mqwm-5m85-gmcv/GHSA-mqwm-5m85-gmcv.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"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"}]}