CVE-2026-22816: Gradle core Gradle Resolves Dependencies From The Vulnerability
HIGHCVE-2026-22816 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 host is unknown. Remediation is available by upgrading affected packages to version 9.3.0, 8.14.4.
CVE-2026-22816 at a Glance
How to Fix CVE-2026-22816
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>9.3.0</version>
</dependency>
<dependency>
<groupId>org.gradle</groupId>
<artifactId>gradle-core</artifactId>
<version>8.14.4</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-22816, 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 9.3.0), 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-22816 Affected Gradle core Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.gradle:gradle-core
|
Maven |
≥ 9.0.0
< 9.3.0
|
9.3.0
|
|
org.gradle:gradle-core
|
Maven |
< 8.14.4
|
8.14.4
|
References
Frequently Asked Questions
What is CVE-2026-22816?
Which Gradle core versions are affected?
What version fixes CVE-2026-22816?
Is gradle-core affected?
What CWE is associated with CVE-2026-22816?
How can I check Maven dependencies for CVE-2026-22816?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-w78c-w6vf-rw82",
"modified" : "2026-12-02T16:20:23Z",
"published" : "2026-11-23T15:33:34Z",
"aliases" : [ "CVE-2026-22816" ],
"summary" : "Gradle resolves dependencies from the next repository when a repository host is unknown",
"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 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.",
"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-w78c-w6vf-rw82"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-22816"
}, {
"type" : "WEB",
"url" : "https://github.com/gradle/gradle/commit/4f2e3bbee4d0cee307dd97b684f11cfbe711b6f3"
}, {
"type" : "WEB",
"url" : "https://github.com/gradle/gradle/commit/e5707d0d8fce3d768c9c489004700d78eab1773a"
}, {
"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:33:34Z",
"nvd_published_at" : "2026-01-16T23:15:50Z"
}
}