abraxaslabs.tech · github.com/abraxas · @abraxas_null · [email protected] · vfs-install-cwd
类别: LPE 影响范围: 本地
VFS for Git master ab95cf51(标签 v2.0.26259.1)- Microsoft
Setup.iss 的 PrepareToInstall 始终通过 {cmd} /S /C 调用 ExecWithResult('gvfs.exe', 'service --list-mounted', '', ...),且 WorkingDir 为空。这会继承管理员启动 SetupGVFS*.exe 时所在的目录。cmd.exe 会先搜索 CWD 再搜索 PATH。UnmountRepos 使用了相同的非限定名称。
同一个文件已经限定了安全路径。sc.exe 是 {sys}\SC.EXE。安装后重新挂载是 {app}\gvfs.exe。首次安装时 PATH 上还没有真正的 gvfs.exe,因此放在已签名安装程序旁边的植入文件会胜出。
| ID | 暂无 CVE |
| 类别 | LPE(提权安装程序 CWD 搜索 / 非限定执行) |
| 影响范围 | 本地(UI:R) |
| CWE | CWE-427、CWE-428 |
| CVSS | 高危:7.3 CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H |
| 产品 | VFS for Git |
| 受影响版本 | master ab95cf51d6ffd0ee0e2feae7180078fe9ecbbb3a(标签 v2.0.26259.1)。仅限 Windows。 |
| 认证 | 本地。在管理员启动 SetupGVFS*.exe 的目录中植入 gvfs.exe。 |
| 许可证 | GNU Affero GPL v3.0 |
| 实验环境 | 仅 127.0.0.1。how=gadget(无原生 SetupGVFS*.exe)。 |
CVE-2021-47874(未加引号的 binPath)的同类问题,但不同的汇聚点。在此版本上,sc.exe 和重新挂载路径已经限定。
在已签名安装程序旁边植入一个无害的 gvfs.exe。当管理员从该文件夹启动安装程序时,PrepareToInstall 会以提权安装程序的身份运行植入文件。
| 权限 | 方法 / 汇聚点 | 授予的能力 | 侦察 / 完整性 / 可用性 | 实验验证或推断 |
|---|---|---|---|---|
| 继承安装程序 CWD | ExecWithResult 空 WorkingDir(Setup.iss 约 830 行) | 搜索从启动文件夹开始 | 搜索顺序的完整性 | 实验验证。Gadget working_dir="",搜索 cwd-then-path。 |
从 CWD 优先于 PATH 解析非限定 gvfs.exe | cmd.exe /S /C ""gvfs.exe" service --list-mounted > ..." | 植入文件优先于 PATH | 完整性 | 实验验证。prepare-resolved=cwd-plant,解析为 /lab/cwd/gvfs.exe。PATH 中的副本未被命中。 |
| 以提权安装程序身份运行 | 见证文件所有者 = gadget uid(代表提权安装程序) | 等同于管理员的代码执行 | 完整性 | 在 gadget uid 上实验验证。此主机上无原生管理员完整性级别。 |
| 卸载时同样的植入 | Exec('gvfs.exe', 'service --unmount-all', '', ...)(Setup.iss 约 544 行) | 植入文件在卸载期间再次运行 | 完整性 | 实验验证。unmount-resolved=cwd-plant。 |
| 植入后继续安装 | 植入文件退出码为 0 且仅写入一个金丝雀文件 | 安装继续 | 安装的可用性 | 实验验证。见证文本为 VFS-INSTALL-CWD-WITNESS。无有效载荷。 |
在此遗留问题上已关闭:重新挂载 {app}\gvfs.exe(remount-resolved=app,remount-plant=no)。加引号的 {sys}\SC.EXE(sc-resolved=sys)。仅 POSIX PATH 搜索(unix-cwd-search=no)。真实的 SetupGVFS*.exe / ProjFS(此主机为 macOS;how=gadget)。远程未认证执行。未加引号的 ImagePath CVE-2021-47874(binPath 已加引号)。
同一版本的其他遗留问题:vfs-quote-breakout、vfs-mount-dehydrate、vfs-clone-acl、vfs-service-sid、vfs-hook-impersonate。
在 2026-09-28 合并后,我锁定了 VFSForGit master ab95cf51。跳过列表是 CVE-2021-47874。Setup.iss 已经为 binPath 加了引号,并限定了 {sys}\SC.EXE 和 {app}\gvfs.exe。PrepareToInstall 仍然将裸 gvfs.exe 传递给 cmd.exe。
已记录的弯路:重新提交 CVE-2021-47874;将仅 POSIX PATH 搜索视为 Windows 漏洞;声称重新挂载也未限定。纯属表演。缺少原生 Windows,因此实验环境是 ExecWithResult 的 gadget 加上 cmd 的 CWD-then-PATH 搜索。
python3 vfs-install-cwd-Abraxas-Labs.py
或
cd lab
./run.sh
Gadget HTTP 位于 127.0.0.1:19680。见证 VFS-INSTALL-CWD-WITNESS。最后一行使用 how=gadget。
SUCCESS vfs-install-cwd how=gadget prepare-resolved=cwd-plant prepare-witness=yes remount-resolved=app remount-plant=no unix-cwd-search=no VFS-INSTALL-CWD-WITNESS
当存在时使用 ExpandConstant('{app}\gvfs.exe'),否则在首次安装时跳过 list-mounted 查询。切勿将裸 gvfs.exe 传递给 cmd.exe。以相同方式限定 UnmountRepos。
ab95cf51d6ffd0ee0e2feae7180078fe9ecbbb3aSetup.iss PrepareToInstall / UnmountRepos / {sys}\SC.EXE / {app}\gvfs.exeImagePathGNU Affero GPL v3.0。参见 LICENSE。仅限回环实验环境。无担保。