CVE-2026-22816: Gradle core Gradle Resolves Dependencies From The Vulnerability

HIGH
Advisory Identifier: GHSA-w78c-w6vf-rw82
CWE-829 CWE-494
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-22816
GHSA Identifier GHSA-w78c-w6vf-rw82
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-829: Inclusion of Functionality from Untrusted Control Sphere
Affected Product Gradle core
Package Ecosystem Maven
Published Date
Last Updated

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.

org.gradle:gradle-core fixed: 9.3.0
<dependency>
    <groupId>org.gradle</groupId>
    <artifactId>gradle-core</artifactId>
    <version>9.3.0</version>
</dependency>
org.gradle:gradle-core fixed: 8.14.4
<dependency>
    <groupId>org.gradle</groupId>
    <artifactId>gradle-core</artifactId>
    <version>8.14.4</version>
</dependency>
Verify Direct and Transitive Dependencies

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

### 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 unresolvable host names [`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. 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. ### 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](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. If 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. You should also review which repositories your builds use to check for unused or outdated repository declarations.

CVE-2026-22816 Affected Gradle core Versions

2 component(s)
Fixed Versions:
9.3.08.14.4
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?
CVE-2026-22816 is a security vulnerability in Gradle core involving Gradle resolves dependencies from the next repository when a repository host is unknown under CWE-829: Inclusion of Functionality from Untrusted Control Sphere.
Which Gradle core versions are affected?
Affected versions include releases prior to 9.3.0, 8.14.4 across affected packages: org.gradle:gradle-core.
What version fixes CVE-2026-22816?
Upgrading to 9.3.0, 8.14.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gradle-core affected?
Yes, org.gradle:gradle-core is affected in releases prior to 9.3.0, 8.14.4. Upgrade your dependency to 9.3.0, 8.14.4 or later.
What CWE is associated with CVE-2026-22816?
CVE-2026-22816 is classified under CWE-829: Inclusion of Functionality from Untrusted Control Sphere (The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.).
How can I check Maven dependencies for CVE-2026-22816?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.gradle'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}