Gradle's failure to disable repositories failing to answer can expose builds to malicious artifacts
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.
Problem Types
| Type | CWE ID | Description |
|---|
| CWE | CWE-494 | CWE-494: Download of Code Without Integrity Check |
| CWE | CWE-829 | CWE-829: Inclusion of Functionality from Untrusted Control Sphere |
Type: CWE
Description: CWE-494: Download of Code Without Integrity Check
Type: CWE
Description: CWE-829: Inclusion of Functionality from Untrusted Control Sphere
Metrics
| Version | Base score | Base severity | Vector |
|---|
| 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 |
Version: 4.0
Base score: 8.6
Base severity: HIGH
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