Security Vulnerability Report
中文
CVE-2026-22865 CVSS 7.4 HIGH

CVE-2026-22865

Published: 2026-01-16 23:15:50
Last Modified: 2026-02-18 16:16:02

Description

Gradle is a build automation tool, and its native-platform tool provides Java bindings for native APIs. When resolving dependencies in versions before 9.3.0, 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. An exception like NoHttpResponseException can indicate transient errors. If the errors persist after a maximum number of retries, Gradle would continue to the next repository. This 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. Gradle has introduced a change in behavior in Gradle 9.3.0 to stop searching other repositories when encountering these errors.

CVSS Details

CVSS Score
7.4
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

Configurations (Affected Products)

cpe:2.3:a:gradle:gradle:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:a:gradle:gradle:*:*:*:*:*:*:*:* - VULNERABLE
Gradle native-platform < 9.3.0
Gradle (所有使用native-platform的版本) < 9.3.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2026-22865 PoC - Gradle Repository Switch Attack Simulation # This PoC demonstrates the vulnerability concept (educational purposes only) import subprocess import time class GradleRepoSwitchPoC: def __init__(self, legitimate_repo, malicious_repo): self.legitimate_repo = legitimate_repo self.malicious_repo = malicious_repo def simulate_attack_scenario(self): """ Simulate Gradle repository switching behavior when legitimate repo is disrupted """ print("[*] CVE-2026-22865 Attack Simulation") print(f"[*] Target: Gradle versions < 9.3.0") print(f"[*] Legitimate Repo: {self.legitimate_repo}") print(f"[*] Malicious Repo: {self.malicious_repo}") # Step 1: Disrupt legitimate repository print("\n[Step 1] Attacker disrupts legitimate repository...") print(f"[*] Sending crafted requests to cause NoHttpResponseException") # Step 2: Observe Gradle behavior print("\n[Step 2] Gradle behavior in vulnerable version:") print("[*] 1. Connection attempt to legitimate repo FAILS") print("[*] 2. Gradle retries (max_retries = 3)") print("[*] 3. All retries exhausted - NO repository disable") print("[*] 4. Gradle silently switches to next repository") # Step 3: Malicious artifact delivery print("\n[Step 3] Malicious repository serves crafted artifact") print(f"[*] {self.malicious_repo}/malicious-library-1.0.jar") print("[*] Artifact contains: backdoor code / data exfiltration") return True def generate_defense_recommendation(self): print("\n[Defense] Recommended mitigation:") print("[*] Upgrade to Gradle 9.3.0 or later") print("[*] Enable repository content verification") print("[*] Implement dependency integrity checks (SHA-256)") if __name__ == "__main__": poc = GradleRepoSwitchPoC( legitimate_repo="https://repo.maven.apache.org/maven2", malicious_repo="https://attacker-controlled-mirror.example.com" ) poc.simulate_attack_scenario() poc.generate_defense_recommendation()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-22865", "sourceIdentifier": "[email protected]", "published": "2026-01-16T23:15:50.280", "lastModified": "2026-02-18T16:16:01.930", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Gradle is a build automation tool, and its native-platform tool provides Java bindings for native APIs. When resolving dependencies in versions before 9.3.0, 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. An exception like NoHttpResponseException can indicate transient errors. If the errors persist after a maximum number of retries, Gradle would continue to the next repository. This 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. Gradle has introduced a change in behavior in Gradle 9.3.0 to stop searching other repositories when encountering these errors."}, {"lang": "es", "value": "Gradle es una herramienta de automatización de compilación, y su herramienta de plataforma nativa proporciona enlaces Java para APIs nativas. Al resolver dependencias en versiones anteriores a la 9.3.0, algunas excepciones no se trataban como errores fatales y no causarían la deshabilitación de un repositorio. Si una compilación encontraba una de estas excepciones, Gradle continuaría con el siguiente repositorio de la lista y potencialmente resolvería dependencias de un repositorio diferente. Una excepción como NoHttpResponseException puede indicar errores transitorios. Si los errores persisten después de un número máximo de reintentos, Gradle continuaría con el siguiente repositorio. Este comportamiento podría permitir a un atacante interrumpir el servicio de un repositorio y aprovechar otro repositorio para servir artefactos maliciosos. Este ataque requiere que el atacante tenga control sobre un repositorio después del repositorio interrumpido. Gradle ha introducido un cambio de comportamiento en Gradle 9.3.0 para dejar de buscar en otros repositorios al encontrar estos errores."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "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", "baseScore": 8.6, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "HIGH", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N", "baseScore": 7.4, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.2, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-494"}, {"lang": "en", "value": "CWE-829"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:gradle:gradle:*:*:*:*:*:*:*:*", "versionEndExcluding": "8.14.4", "matchCriteriaId": "641EFE35-6227-4F41-A541-BB1B5410310E"}, {"vulnerable": true, "criteria": "cpe:2.3:a:gradle:gradle:*:*:*:*:*:*:*:*", "versionStartIncluding": "9.0.0", "versionEndExcluding": "9.3.0", "matchCriteriaId": "734289A3-4267-4B9 ... (truncated)