Exploited now
Vulnerability WatchVulnerabilities, exploits & advisories — updated every 15 minutes
Alerts

Home › CVE › Java

CVE-2026-22816 — Gradle causes Failure to disable repositories can expose builds to malicious artifacts

High · CVSS 8.6EPSS 0.2% First seen November 23, 2026

One of 2 maven:org.gradle:gradle-core vulnerabilities published together by GitHub Advisory: our article covers all of them.

JavaWebVulnerabilities

Research article

Gradle dependency resolution can fall back to other repositories after an unresolvable host (CVE-2026-22816)

CVECVE-2026-22816
Vendor and productmaven:org.gradle:gradle-core
PublishedNovember 23, 2026 16:20 UTC
Research cut-offNovember 23, 2026 16:15 UTC
Sources reviewed5: NVD record (last modified 2026-06-17); CISA KEV catalog; GitHub advisory (2026-11-23); vendor advisory page (github.com)

Executive summary

CVE-2026-22816 affects Gradle, a build tool, where an unresolvable repository host did not stop dependency resolution, so a build could keep going and take artifacts from a later repository, or from a host an attacker registers under the lapsed or mistyped name [3, 4]. NVD scores it CVSS 3.1 7.4 High (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N) and CVSS 4.0 8.6 High (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) [1]. NVD and the GitHub advisory list Gradle versions below 8.14.4 and from 9.0.0 below 9.3.0 as affected, fixed in 8.14.4 and 9.3.0 respectively [1, 3]. Exploitation requires that the affected repository is placed ahead of other repositories in the build configuration [4]. The CISA KEV catalog did not list the CVE as of 2026-11-23, and the reviewed advisories state no exploitation status [2, 5]. The most important immediate action is to upgrade Gradle to 8.14.4 or 9.3.0 and, where upgrading is not yet possible, to configure dependency verification and review repository declarations [4].

Key points

  • CVE-2026-22816 lets a Gradle build keep resolving dependencies after a repository's host name fails to resolve, so artifacts can come from a later repository or from a name an attacker registers [3, 4].
  • NVD scores it CVSS 3.1 7.4 High and CVSS 4.0 8.6 High [1].
  • Affected: Gradle below 8.14.4 and from 9.0.0 below 9.3.0; fixed in 8.14.4 and 9.3.0 [1, 3].
  • Exploitation requires the affected repository to be declared ahead of others and its host name to be unresolvable [4].
  • Not listed in CISA KEV as of 2026-11-23; no exploitation status, proof of concept or indicators are given in the reviewed advisories [2, 5].

Vulnerability identification

FieldValue
CVE IDCVE-2026-22816 [1]
Vendor and productGradle build tool [1, 3]
ComponentDependency resolution across declared repositories; GitHub package coordinate org.gradle:gradle-core [3, 4]
NVD record statusAnalyzed; published 2026-01-16T23:15:50; last modified 2026-06-17T10:20:28 [1]
GitHub advisoryGHSA-w78c-w6vf-rw82; published 2026-11-23T15:33:34; updated 2026-11-23T15:39:17 [3]
CWECWE-494 (code downloaded without an integrity check) and CWE-829 (inclusion of functionality from an untrusted control sphere) [1, 3, 4]
CVSS 4.0, NVD8.6 High; 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, with supplemental and environmental metrics set to X; scored by security-advisories@github.com as Secondary [1]
CVSS 3.1, NVD7.4 High; CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N; scored by nvd@nist.gov as Primary [1]
CVSS 4.0, GitHub8.6; 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; scored by GitHub [3]
Patch referenceCommit e5707d0d8fce3d768c9c489004700d78eab1773a, tagged Patch in the NVD record [1]
Related itemsGHSA-mqwm-5m85-gmcv (repositories failing to answer) and Gradle issue 35927 (failing fast on bad repositories), both linked from the GitHub advisory [3]

The two CVSS 4.0 scores agree. The CVSS 3.1 vector sets user interaction to none (UI:N), while the CVSS 4.0 vector sets it to passive (UI:P). The sources do not explain this difference. The NVD record was published in January 2026, but the GitHub advisory was published on 2026-11-23, so the public advisory is much later than the CVE record [1, 3].

Vulnerability description

The flaw concerns the integrity of build inputs. When a repository's host name cannot be resolved, affected Gradle versions did not stop searching; they continued to the next declared repository [4]. The vendor states that an attacker could register a service under the unresolvable host name and serve malicious artifacts to the build [4]. The build keeps working as long as every dependency is found in another configured repository, which means the affected repository can be silently bypassed [4].

The flaw matters only when the affected repository is listed ahead of other repositories and its host name does not resolve [4]. Unresolvable names can come from a lapsed domain registration, a mistyped domain or DNS misconfiguration [4]. The sources do not establish that the flaw allows access to the build machine itself, privilege escalation, or code execution outside the build's artifact resolution path.

Technical background

Gradle resolves dependencies by checking each repository declared in the build in the order the build lists them [4]. A repository is identified by a host name, which must map to an IP address. When it does not, the Java networking layer raises UnknownHostException, and the vendor identifies this exception as the one at the centre of the flaw [4]. The vendor names two Gradle features that restrict which content may come from which repository: strict repository content filtering and dependency verification [4].

Root cause analysis

Confirmed (vendor): earlier Gradle versions treated some exceptions from a failing repository as non-fatal, so the repository was not disabled and Gradle moved to the next one in the list [4]. Gradle 9.3.0 and 8.14.4 changed this so that resolution stops searching further repositories when these errors occur [4].

Analyst assessment: the design prioritizes build completion over provenance. An unresolvable repository is handled like a missing artifact, so the build succeeds with artifacts from another source and produces no error that signals the substitution. This is why ordinary build success does not show that the intended repository supplied the dependencies. The sources do not show the code-level change that implements the fix, so the exact code path is unknown.

Technical mechanics

  1. The build script lists repositories in order, for example an internal repository first and a public repository second [4].
  2. For each dependency, Gradle queries the first repository [4].
  3. The host name of the first repository does not resolve, and the resolver raises UnknownHostException [4].
  4. In affected versions, the exception does not fail the resolution. Gradle does not disable the repository and moves to the next one [4].
  5. The next repository supplies the artifact, and the build completes [4].
  6. In fixed versions (8.14.4 and 9.3.0), resolution stops at the failing repository for these errors rather than searching further [4].

Illustrative: if the unresolvable host is a lapsed domain that an attacker then registers, the same resolution order would send the request to the attacker's service before any later repository. The vendor describes this scenario but no source documents it occurring [4, 5].

The controls that should have prevented this are repository content filtering and dependency verification, which the vendor says make builds safe from the described issues [4].

Attack surface and exploitation prerequisites

FactorAssessmentSource
Access vectorNetwork; the attacker must be able to serve content under the affected host nameVector AV:N [1, 3]; registration of the host name [4]
AuthenticationNone required per the vectorPR:N [1, 3]
User interactionCVSS 4.0 records passive interaction (UI:P); CVSS 3.1 records none (UI:N)[1]
Attack complexityHigh, and attack requirements present, per the CVSS 4.0 vectorAC:H, AT:P [1, 3]
Required configurationAffected repository declared ahead of other repositories[4]
Required host stateThe declared host name does not resolve, through lapse, typo or DNS misconfiguration[4]
Dependency availabilityBuild still completes only if the other repositories supply every dependency[4]
Required featuresNone beyond the default multi-repository resolution, per the sources; strict content filtering or dependency verification are vendor mitigations[4]

The vector prerequisites (network access, no privileges, high complexity) are given by the scoring. The ordering and host-state prerequisites come from the vendor text.

Impact analysis

Security propertyTechnically described impactSource
IntegrityHigh; malicious artifacts can enter the buildVI:H [1]; vendor description [4]
ConfidentialityScored High by NVD and GitHub, but the vendor text does not describe a confidentiality effectVC:H [1, 3]; [4]
AvailabilityNone scoredVA:N [1, 3]
Authentication and authorizationNo effect described in the sources[1, 4]
Downstream consequencesAnalyst assessment: artifacts from an untrusted source may end up in build outputs that are then distributed or deployed, but no source documents this[4]

Affected products and versions

SourceAffected versionsFixed versions
CVE record from the CNA [1]Gradle versions below 9.3.09.3.0
NVD configuration [1]Below 8.14.4; and 9.0.0 up to but not including 9.3.08.14.4; 9.3.0
GitHub advisory, org.gradle:gradle-core [3]Below 8.14.4; and 9.0.0 up to but not including 9.3.08.14.4; 9.3.0

Discrepancy: the CNA's single range (below 9.3.0) would include 8.14.4, the version the NVD and GitHub data record as fixed on the 8.x line. The NVD and GitHub ranges are more specific, so use them for triage and treat the CNA range as broader. No source gives a lower bound for the affected range. NVD's wording covers every version below 8.14.4 without a lower limit.

Configuration exposure: a build is exposed only if it declares an affected-range Gradle version and an unresolvable repository placed ahead of others [4]. The vendor says builds using strict repository content filtering or dependency verification are safe from the described issues [4]. This is a vendor claim limited to the described issues.

Exploitation and threat intelligence status

The CVE is not listed in the CISA KEV catalog as of 2026-11-23. CISA's entry notes that this is not evidence of no exploitation [2]. The reviewed advisories state no exploitation status, no proof-of-concept availability and no credited researchers [5]. The vendor describes an attack path but does not report any observed case [4]. No threat actor, campaign or sector is attributed in the sources.

Confirmed exploitation in the wild: none documented. Public proof of concept: none documented. Theoretical exploitability: the vendor's description of registering the host name [4].

Detection and exposure assessment

  1. Inventory Gradle versions. In each project that uses the Gradle wrapper, run ./gradlew --version from the project root. This is standard Gradle tooling, read-only, and prints a line naming the Gradle version. Compare the result with the affected ranges above. Limitation: the version alone does not show whether repositories are declared in an exploitable order, so it is not proof of exposure.
  2. Check the wrapper configuration. Open gradle/wrapper/gradle-wrapper.properties and read the distributionUrl value to confirm the version the wrapper downloads. This is standard Gradle wrapper layout, not a source-given command.
  3. Audit repository declarations. In each settings or build script, list the repository entries in declaration order and note any entry that is unused or outdated, which the vendor says to review [4].
  4. Resolve each declared host name from the build environment, such as the CI runner, using a read-only DNS lookup. Failures identify the unresolvable hosts that the vulnerability depends on [4]. Limitation: results depend on the resolver and network of the environment that runs the query.
  5. Search existing build logs for the exception name UnknownHostException, which the vendor identifies as the trigger [4]. A match shows that an unresolvable host was encountered during resolution. It does not show that artifacts were substituted, and the sources give no log format beyond the exception name.
  6. Check for dependency verification configuration. The vendor recommends it [4]. Confirm whether the build has verification enabled in its own configuration.

Remediation

Immediate mitigation (vendor-recommended, not a fix):

  • Configure dependency verification. The vendor calls this the best way to ensure only expected dependencies are resolved, and recommends it if upgrading is not possible [4]. It protects against substitution of unexpected artifacts. Limitation: the sources do not give a configuration procedure, and it must be maintained as dependencies change. Verify by confirming a build fails when an artifact's checksum is changed in a test copy.
  • Review and remove unused or outdated repository declarations [4]. This removes the unresolvable entries that the attack depends on. Side effect: builds that relied on the entries will fail. Verify with the repository audit above.
  • Use strict repository content filtering, which the vendor says makes builds safe from the described issues [4]. Limitation: the sources do not describe its configuration.

Permanent fix (vendor-confirmed):

  • Upgrade Gradle to 8.14.4 on the 8.x line, or to 9.3.0 on the 9.x line [1, 3, 4]. The vendor states that these versions protect against the described vulnerabilities [4]. The patch commit is e5707d0d8fce3d768c9c489004700d78eab1773a [1], and the advisory is GHSA-w78c-w6vf-rw82 [3].
  • Verify the upgrade by running ./gradlew --version and confirming the reported version is 8.14.4 or 9.3.0 or later [1, 3].

Recommended hardening: keep dependency verification and repository review in place after upgrading, because a related issue reports that fail-fast handling for bad repositories does not appear to be implemented [3, 4].

Workarounds and compensating controls

Dependency verification and strict repository content filtering are the vendor's alternatives when an upgrade is not possible [4]. Their residual risk is that they are configuration-dependent, and the vendor does not state that they match the fixed behaviour. The related fail-fast issue suggests the underlying handling of bad repositories remains open, so workarounds limit exposure without removing the defect [3, 4]. These controls are not equivalent to upgrading, since the vendor names the upgrade as the protection [4].

Remediation checklist

  1. Inventory every Gradle build and wrapper version by running ./gradlew --version in each project and recording the result; flag anything below 8.14.4 on the 8.x line or 9.0.0 to below 9.3.0 [1, 3].
  2. Upgrade affected builds to Gradle 8.14.4 (8.x line) or 9.3.0 (9.x line) by updating the wrapper, then rerun ./gradlew --version to confirm [1, 3, 4].
  3. Until upgrading, configure dependency verification in each build, as the vendor recommends, and test that a changed artifact checksum fails the build [4].
  4. Audit each settings and build script for repository declarations; remove unused or outdated entries and note the order of the remaining ones [4].
  5. Resolve every declared repository host name from the CI runner with a read-only DNS lookup; investigate any name that fails, since lapsed or mistyped domains are the vendor's named causes [4].
  6. Search existing CI and local build logs for UnknownHostException to identify builds that encountered unresolvable repositories; treat matches as a reason to review that build's resolved artifacts [4].
  7. Enable strict repository content filtering where feasible, as the vendor describes it as a safe configuration for the described issues [4].
  8. After upgrading, keep dependency verification and repository review active, because a related fail-fast issue is reported as not implemented [3, 4].

Evidence gaps

  • Not established by the reviewed sources: exploitation in the wild, KEV status change or proof-of-concept code. Would be settled by a later KEV entry, vendor incident report or public exploit reference.
  • Not established by the reviewed sources: indicators of compromise, log formats or detection queries beyond the exception name. Would be settled by vendor detection guidance or an incident report.
  • Not established by the reviewed sources: a lower bound for the affected range and whether earlier 8.x releases or 9.0.0 onward were all tested. Would be settled by the vendor's complete affected-version list.
  • Discrepancy: the CNA record's single affected range (below 9.3.0) conflicts in scope with the NVD and GitHub ranges; the vendor's corrected range is not stated in the sources. Would be settled by a vendor correction to the CVE record.
  • Not established by the reviewed sources: the code-level change that makes resolution stop, and whether the fix covers every exception path. Would be settled by the linked commit e5707d0d8fce3d768c9c489004700d78eab1773a and Gradle issue 35927.
  • Not established by the reviewed sources: the content of related advisory GHSA-mqwm-5m85-gmcv, which the GitHub entry links but the pack does not summarize. Would be settled by reviewing that advisory.
  • Not established by the reviewed sources: whether upgrading requires a build restart or cache reset, and any rollback procedure. Would be settled by Gradle upgrade documentation.
  • Not established by the reviewed sources: configuration steps for dependency verification and strict repository content filtering. Would be settled by Gradle's documentation for these features.
  • Discrepancy: CVSS 3.1 records no user interaction while CVSS 4.0 records passive interaction. Would be settled by the scorers' rationale, which the sources do not provide.
  • Date discrepancy: the NVD record was published in January 2026, but the GitHub advisory was published on 2026-11-23. The sources do not explain the timing.

References

  1. CVE-2026-22816 record. NIST National Vulnerability Database (NVD), 2026-06-17. https://nvd.nist.gov/vuln/detail/CVE-2026-22816. Accessed 2026-11-23. CVE identity, NVD record status and dates, CVSS 4.0 and 3.1 scores, vectors and scorers, CWE mappings, CNA affected range, NVD CPE ranges and fixed versions, patch commit reference, and the UI discrepancy between scores.
  2. Known Exploited Vulnerabilities Catalog. Cybersecurity and Infrastructure Security Agency (CISA), 2026-11-23. https://www.cisa.gov/known-exploited-vulnerabilities-catalog. Accessed 2026-11-23. CISA KEV status as of 2026-11-23, with the note that absence is not evidence of no exploitation.
  3. GHSA-w78c-w6vf-rw82 / CVE-2026-22816 — Gradle causes Failure to disable repositories can expose builds to malicious artifacts. GitHub Security Advisory Database, 2026-11-23. https://github.com/advisories/GHSA-w78c-w6vf-rw82. Accessed 2026-11-23. GitHub advisory identifier and dates, GitHub CVSS 4.0 score and vector, package coordinate org.gradle:gradle-core with affected and fixed ranges, related advisory and Gradle issue links, and the CWE mappings.
  4. Vendor advisory page (github.com). github.com. https://github.com/gradle/gradle/security/advisories/GHSA-w78c-w6vf-rw82. Accessed 2026-11-23. Vendor description of repository ordering, UnknownHostException trigger, earlier non-fatal exception handling, attack prerequisites, host-name registration scenario, fixed behaviour, upgrade protection claim, dependency verification and repository review recommendations, and the fail-fast related is
  5. Further facts from the advisories reviewed. github.com. https://github.com/gradle/gradle/security/advisories/GHSA-w78c-w6vf-rw82. Accessed 2026-11-23. Absence of exploitation status, proof-of-concept availability, credited researchers, indicators of compromise and detection queries in the reviewed advisories.

Written with AI assistance from the 5 sources listed above, as of the research cut-off; each fact is cited to its source. Check the vendor's advisory before acting.

Severity breakdown

High · 8.6 CVSS 4.0 base score from the CNA (github.com)

An attacker without an account can exploit this over the network if a user views or visits something, but only under specific conditions.

Attack from
the network (remotely)
Attack complexity
high (only works under specific conditions)
Special conditions
only in some setups or conditions
Login needed
no
User action needed
yes, a user must view or visit something
Impact
high on confidentiality and integrity, none on availability
Impact on other systems
high on integrity, none on confidentiality and availability

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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X · CVSS 3.1 7.4 from NVD: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N · CVSS 4.0 8.6 from GitHub: 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

Weakness

  • CWE-494: Download of Code Without Integrity Check
  • CWE-829: Inclusion of Functionality from Untrusted Control Sphere

Affected and fixed versions

ProductAffected versionsFixed in
org.gradle:gradle-core (Maven)< 8.14.48.14.4
≥ 9.0.0, < 9.3.09.3.0
gradle< 9.3.0—

From the GitHub Advisory Database and the vendor's CVE record; confirm with the vendor advisory before relying on a version number.

References by type

Vendor advisories

Patches and fixed releases

Other references

Details from NVD (public domain), the GitHub Advisory Database (CC BY 4.0).

Details

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 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 and / or dependency verification, your build is safe from the potential vulnerabilities described above.

If you cannot update to a newer Gradle version, configuring dependency verification 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.

Related

Source: GHSA-w78c-w6vf-rw82 / CVE-2026-22816, GitHub Advisory Database, licensed CC BY 4.0.

Affected

  • maven:org.gradle:gradle-core

Frequently asked questions

What is CVE-2026-22816?

CVE-2026-22816 affects Gradle, a build tool, where an unresolvable repository host did not stop dependency resolution, so a build could keep going and take artifacts from a later repository, or from a host an attacker registers under the lapsed or mistyped name. Weakness type: Download of Code Without Integrity Check (CWE-494).

How severe is CVE-2026-22816?

CVE-2026-22816 has a CVSS 4.0 base score of 8.6 (high), from the CNA (github.com). An attacker without an account can exploit this over the network if a user views or visits something, but only under specific conditions.

Is CVE-2026-22816 being exploited?

Not as far as is known: CVE-2026-22816 is not in CISA's Known Exploited Vulnerabilities catalog as of November 30, 2026. EPSS estimates a 0.2% chance that it is exploited in the next 30 days.

Which versions are affected by CVE-2026-22816?

org.gradle:gradle-core (Maven) < 8.14.4 (fixed in 8.14.4); org.gradle:gradle-core (Maven) ≥ 9.0.0, < 9.3.0 (fixed in 9.3.0); gradle < 9.3.0.

How do I fix CVE-2026-22816?

Inventory every Gradle build and wrapper version by running ./gradlew --version in each project and recording the result; flag anything below 8.14.4 on the 8.x line or 9.0.0 to below 9.3.0. Upgrade affected builds to Gradle 8.14.4 (8.x line) or 9.3.0 (9.x line) by updating the wrapper, then rerun ./gradlew --version to confirm. Until upgrading, configure dependency verification in each build, as the vendor recommends, and test that a changed artifact checksum fails the build.

Timeline & sources

References

Related vulnerabilities & news