IPBUF安全漏洞报告
English
CVE-2026-44471 CVSS 7.8 高危

CVE-2026-44471 Gitoxide符号链接验证绕过漏洞

披露日期: 2026-05-13

漏洞信息

漏洞编号
CVE-2026-44471
漏洞类型
符号链接攻击
CVSS评分
7.8 高危
攻击向量
本地 (AV:L)
认证要求
无需认证 (PR:N)
用户交互
需要交互 (UI:R)
影响产品
Gitoxide

相关标签

符号链接攻击路径遍历任意文件写入GitoxideRust

漏洞概述

Gitoxide是用Rust编写的Git实现工具。在0.21.1版本之前,由于路径验证缓存机制存在缺陷,攻击者可构造恶意tree对象。当用户使用gitoxide检出该tree时,攻击者能绕过安全检查,将受控的符号链接写入用户拥有写权限的任意现有目录,可能导致敏感文件被覆盖或劫持。

技术细节

该漏洞源于gitoxide在检出时处理符号链接的逻辑缺陷。所有符号链接索引条目会被延迟,并使用单个共享的`gix_worktree::Stack`在常规文件之后创建。`gix_fs::Stack::make_relative_path_current()`内部会缓存经过验证的路径前缀。当处理的新路径的前导组件与之前处理的叶子组件完全匹配时,系统仅调用`delegate.push_directory()`,而跳过了`delegate.push()`。由于`push()`方法包含`symlink_metadata()`检查和冲突时的解除链接操作,跳过该步骤意味着安全检查被绕过。最终,`std::os::unix::fs::symlink`在创建符号链接时会跟随父目录中的符号链接。攻击者利用这一机制,提供包含重复符号链接和目录条目的tree对象,即可实现将符号链接写入任意位置。

攻击链分析

STEP 1
1. 侦察
攻击者确认目标使用的是0.21.1之前的Gitoxide版本。
STEP 2
2. 构造
攻击者构造一个包含恶意tree对象的Git仓库,该对象利用重复的符号链接和目录条目。
STEP 3
3. 投递
诱导受害者克隆或下载该恶意仓库,并执行checkout操作。
STEP 4
4. 利用
Gitoxide处理checkout时,由于缓存机制跳过了关键的安全检查(symlink_metadata)。
STEP 5
5. 影响
攻击者成功在受害者系统上的任意可写目录中写入符号链接,可能导致文件覆盖或权限提升。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import os import subprocess # Proof of Concept for CVE-2026-44471 # This script demonstrates the setup for a malicious repository structure. # Exploitation requires gitoxide < 0.21.1 to checkout the repository. def create_exploit_repo(): repo_dir = "gitoxide_poc_cve_2026_44471" if os.path.exists(repo_dir): os.rmdir(repo_dir) os.makedirs(repo_dir) os.chdir(repo_dir) # Initialize git repo subprocess.run(["git", "init"]) # Create a file that will later be part of the directory structure # to trigger the leaf-to-directory caching issue. with open("legit_file", "w") as f: f.write("This is a legitimate file.") subprocess.run(["git", "add", "legit_file"]) subprocess.run(["git", "commit", "-m", "Initial commit"]) # To actually exploit CVE-2026-44471, one must manually craft Git tree objects # that contain duplicate entries where a directory is replaced by a symlink # or vice versa in a way that confuses the gix_fs::Stack cache. # Below is a conceptual representation. print(f"Repository initialized at {os.getcwd()}") print("To exploit: Manually craft tree objects with conflicting directory/symlink paths.") print("Then run: gitoxide checkout") if __name__ == "__main__": create_exploit_repo()

影响范围

Gitoxide < 0.21.1

防御指南

临时缓解措施
建议用户立即将Gitoxide升级至0.21.1或更新版本。如果不能立即升级,应避免使用受影响的版本检出不受信任的Git仓库,或在沙箱隔离环境中进行操作,以防止符号链接攻击导致本地文件被篡改。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表