IPBUF安全漏洞报告
English
CVE-2026-35492 CVSS 6.5 中危

CVE-2026-35492: Kedro-Datasets路径遍历漏洞

披露日期: 2026-04-07

漏洞信息

漏洞编号
CVE-2026-35492
漏洞类型
路径遍历
CVSS评分
6.5 中危
攻击向量
网络 (AV:N)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
Kedro-Datasets

相关标签

路径遍历Kedro-DatasetsCWE-22文件覆盖

漏洞概述

Kedro-Datasets 插件在 9.3.0 版本前存在路径遍历漏洞。PartitionedDataset 组件在拼接分区 ID 与基础路径时未进行有效验证。攻击者可利用包含“..”的恶意输入,将文件写入配置目录之外,覆盖文件系统上的任意文件,影响本地及云存储后端。

技术细节

该漏洞源于 Kedro-Datasets 中 PartitionedDataset 类对文件路径的处理缺乏必要的安全校验机制。在受影响版本中,组件直接将用户提供的分区 ID 与预设的基础路径进行字符串拼接,且未对 ID 中可能包含的特殊字符(如“../”或绝对路径符号)进行过滤或规范化处理。攻击者可构造特制的分区 ID,利用此漏洞突破预期的目录限制,将数据写入文件系统、AWS S3 或 Google Cloud Storage 的任意位置。这种攻击可能导致关键系统文件被恶意覆盖、敏感信息泄露或服务拒绝,对数据的完整性和系统的可用性构成严重威胁。

攻击链分析

STEP 1
侦察
攻击者确认目标系统使用了存在漏洞的 Kedro-Datasets 版本(< 9.3.0),并识别出 PartitionedDataset 的使用场景。
STEP 2
武器化
攻击者构造包含路径遍历字符(如 "../")的恶意分区 ID(Partition ID),旨在将文件路径指向预期目录之外的位置。
STEP 3
交付
攻击者通过应用程序接口提交包含恶意分区 ID 的数据写入请求。
STEP 4
利用
由于缺乏验证,应用程序将恶意 ID 与基础路径直接拼接,导致数据被写入到攻击者指定的任意路径(如系统配置文件或关键脚本)。
STEP 5
影响
文件系统上的任意文件被覆盖或篡改,可能导致系统受损、数据丢失或权限提升。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import os # Proof of Concept for CVE-2026-35492 Path Traversal # This simulates the vulnerable behavior in Kedro-Datasets < 9.3.0 def vulnerable_save(base_path, partition_id, data): # Simulate the vulnerable code logic: direct concatenation without validation # In the actual library, this leads to writing outside the intended directory full_path = os.path.join(base_path, partition_id) # Check if the path is normalized (which the vulnerable code fails to enforce properly) print(f"[VULNERABLE] Attempting to write to: {full_path}") # In a real scenario, this would write 'data' to 'full_path' # potentially overwriting sensitive files like ../../etc/passwd with open(full_path, 'w') as f: f.write(str(data)) # Configuration base_directory = "./safe_dataset_folder" # Malicious partition ID containing path traversal sequences malicious_input = "../../arbitrary_file.txt" print(f"Base Directory: {base_directory}") print(f"User Partition ID: {malicious_input}") # Execute the vulnerable operation # This would result in writing to ./arbitrary_file.txt instead of ./safe_dataset_folder/... vulnerable_save(base_directory, malicious_input, "MALICIOUS_PAYLOAD")

影响范围

Kedro-Datasets < 9.3.0

防御指南

临时缓解措施
如果无法立即升级,建议在应用层面对传入 PartitionedDataset 的所有分区 ID 实施严格的输入过滤,禁止包含“..”、“/”、绝对路径等特殊字符的输入,以防止路径遍历攻击。

参考链接

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