安全6.5k · #13964
path-traversal
它能做什么
这项技能是一份简短的路径遍历漏洞排查指南。路径遍历是指经过构造的文件名借助文件夹跳转,越过应用本应限定的文件夹。适合检查自己有权测试的代码的开发人员和审查人员。
适用场景
- ✓当开发人员要求智能体检查用户输入能否进入文件下载或上传代码时。
- ✓当智能体审查压缩包解压代码中,是否存在指向目标文件夹之外的条目时。
- ✓当团队需要确认路径检查是在允许的文件夹测试之前运行时。
技能链接
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/path-traversal/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
请用这个技能帮我:https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/analyst/path-traversal/SKILL.md
阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
npx skills add BitterSecurity/Decepticon --skill path-traversal
下载 SKILL.md,放进智能体的技能文件夹。
curl -L https://raw.githubusercontent.com/BitterSecurity/Decepticon/main/packages/decepticon/decepticon/skills/standard/analyst/path-traversal/SKILL.md -o SKILL.md
可以这样问 AI
“请帮我检查我们已获授权的应用,看看用户提供的文件名能否访问上传文件夹之外的文件?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体找到打开或发送文件的代码,把用户输入追踪到这些调用,并检查路径是否被限制在预定的文件夹内。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Path Traversal Playbook
Find sinks
open(user_path),send_file(user_path), file download endpoints, archive extraction APIs.
Probe payload classes
- Relative traversal:
../../../../etc/passwd - Encoded traversal:
%2e%2e%2f - Mixed separators:
..\\..\\windows\\win.ini - Archive traversal: entries like
../../app/config.py
Verify controls
- Canonicalization done before allowlist check.
- Path confinement to intended root.
Validation
Confirm unauthorized file read/write outside allowed directory with positive and negative controls.
常见问题
什么是路径遍历?
就是经过构造的文件名利用文件夹跳转,访问应用本不应共享的文件。
为什么该技能提到压缩包?
它指出,压缩包中带有文件夹跳转的条目,在解压时同样可能越过目标文件夹。
什么能证明这个漏洞?
该技能要求一项读取文件夹之外文件的正向测试,以及一项被拦截的反向测试。
详情
作者的原始描述
Hunt directory traversal and archive traversal (ZipSlip/TarSlip) from user input to filesystem operations.
热度
- GitHub 星标
- 6.5k
- 排名
- #13964
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/1
评论
- …