CVE-2026-22865: Gradle core Gradle Resolves Dependencies From The Vulnerability
HIGHCVE-2026-22865 is a HIGH gradle resolves dependencies from the vulnerability (CWE-829: Inclusion of Functionality from Untrusted Control Sphere) affecting Gradle core libraries in the Maven ecosystem. The issue involves gradle resolves dependencies from the next repository when a repository does not answer. Remediation is available by upgrading affected packages to version 8.14.4, 9.3.0.
CVE-2026-22865 at a Glance
How to Fix CVE-2026-22865
To remediate this vulnerability, upgrade all affected Gradle core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.gradle</groupId>
<artifactId>gradle-core</artifactId>
<version>8.14.4</version>
</dependency>
<dependency>
<groupId>org.gradle</groupId>
<artifactId>gradle-core</artifactId>
<version>9.3.0</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.gradle
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2026-22865, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.gradle
Analyze the terminal output to locate any version of Gradle core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.14.4), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.gradle command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-829: Inclusion of Functionality from Untrusted Control Sphere, where the product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. In Gradle core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-22865 Affected Gradle core Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.gradle:gradle-core
|
Maven |
< 8.14.4
|
8.14.4
|
|
org.gradle:gradle-core
|
Maven |
≥ 9.0.0
< 9.3.0
|
9.3.0
|
References
Frequently Asked Questions
What is CVE-2026-22865?
Which Gradle core versions are affected?
What version fixes CVE-2026-22865?
Is gradle-core affected?
What CWE is associated with CVE-2026-22865?
How can I check Maven dependencies for CVE-2026-22865?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mqwm-5m85-gmcv",
"modified" : "2026-12-02T16:21:01Z",
"published" : "2026-11-23T15:41:57Z",
"aliases" : [ "CVE-2026-22865" ],
"summary" : "Gradle resolves dependencies from the next repository when a repository does not answer",
"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### References\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) \n\nMore about this type of vulnerabilities:\n\n* https://cwe.mitre.org/data/definitions/494.html\n* https://cwe.mitre.org/data/definitions/829.html",
"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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.gradle:gradle-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "8.14.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.gradle:gradle-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "9.0.0"
}, {
"fixed" : "9.3.0"
} ]
} ]
} ],
"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"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-494", "CWE-829" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-11-23T15:41:57Z",
"nvd_published_at" : "2026-01-16T23:15:50Z"
}
}