支持本站 — 捐款将帮助我们持续运营

目标:1000 元,已筹:736

73.6%
一、 漏洞 CVE-2026-22865 基础信息
漏洞信息
                                        # Gradle 仓库响应失败漏洞

## 概述
Gradle 在版本 9.3.0 之前,处理依赖解析时对某些异常未视为致命错误,导致在遇到如 `NoHttpResponseException` 等异常后不会禁用当前仓库,而是继续尝试下一个仓库。

## 影响版本
版本低于 9.3.0 的 Gradle。

## 细节
当依赖解析过程中发生 `NoHttpResponseException` 等异常时,Gradle 未将其标记为仓库不可用,即使重试次数已达上限,仍会继续尝试后续仓库。该机制在持久性异常情况下仍继续搜索其他仓库,造成依赖可能从后续仓库中被解析。

## 影响
攻击者可利用此行为,在控制位置靠后的仓库前提下,通过干扰前序仓库服务(如引发持续网络异常),诱使 Gradle 切换至恶意仓库并下载恶意构件,导致供应链攻击。
                                        
神龙判断

是否为 Web 类漏洞: 未知

判断理由:

N/A
提示
尽管我们采用了先进的大模型技术,但其输出仍可能包含不准确或过时的信息。
神龙会尽力确保数据准确,但也请结合实际情况进行甄别与判断。
神龙祝您一切顺利!
漏洞标题
Gradle's failure to disable repositories failing to answer can expose builds to malicious artifacts
来源:美国国家漏洞数据库 NVD
漏洞描述信息
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.
来源:美国国家漏洞数据库 NVD
CVSS信息
N/A
来源:美国国家漏洞数据库 NVD
漏洞类别
下载代码缺少完整性检查
来源:美国国家漏洞数据库 NVD
二、漏洞 CVE-2026-22865 的公开POC
#POC 描述源链接神龙链接
三、漏洞 CVE-2026-22865 的情报信息
  • 标题: Failure to disable repositories failing to answer can expose builds to malicious artifacts · Advisory · gradle/gradle · GitHub -- 🔗来源链接

    标签:x_refsource_CONFIRM

    神龙速读:
                                            ### 关键漏洞信息
    
    #### 漏洞描述
    当解析依赖项时,Gradle 会按声明顺序搜索仓库。如果遇到连接错误,Gradle 会禁用该仓库并导致依赖项解析失败。这在可重复制性和安全性方面是必要的,以防止依赖项从其他仓库解析而没有警告。
    
    在以前的版本中,Gradle 未能将某些异常作为致命错误处理,因此在遇到这些异常时,不会禁用仓库。如果构建遇到了这些异常之一,Gradle 会继续去下一个仓库,并可能从不同的仓库解析依赖项。
    
    #### 影响
    如果在达到最大重试次数后,Gradle 仍继续尝试从下一个仓库解析依赖项,可能会导致服务被攻击者破坏,并利用另一个仓库提供恶意工件。
    
    #### 漏洞修复
    Gradle 在 9.3.0 和 8.14.4 版本中引入了行为更改,以在遇到错误时停止搜索其他仓库。
    
    #### 修复方案
    升级到 9.3.0 或 8.14.4 可以保护您免受上述漏洞的影响。
    
    #### 工作区绕过
    如果你无法更新 Gradle 版本,配置 `dependency verification` 是确保构建仅解析预期依赖项的最佳方法。
    
    #### 引用
    - [安全功能在失败仓库上快速失败似乎未实现](https://github.com/gradle/gradle/issues/6805)
    - [仓库禁用](https://github.com/gradle/gradle/blob/6b939fa58b908570ce5b4eb8e998800e6c502fde/subprojects/core/src/main/java/org/gradle/api/artifacts/ResolvedRepository.java#L31)
    - [有关未知主机的仓库的建议](https://docs.gradle.org/current/userguide/artifact_dependencies_tutorial.html#sec:dependency_verification)
    
    #### 相关漏洞类型
    - [CWE-494](https://cwe.mitre.org/data/definitions/494.html)
    - [CWE-829](https://cwe.mitre.org/data/definitions/829.html)
                                            
    Failure to disable repositories failing to answer can expose builds to malicious artifacts · Advisory · gradle/gradle · GitHub
  • https://nvd.nist.gov/vuln/detail/CVE-2026-22865
四、漏洞 CVE-2026-22865 的评论

暂无评论


发表评论