| 标题 | XiangLi1999 Diffusion-LM commit 759889d58ef3 Path Traversal |
|---|
| 描述 | A vulnerability was found in Diffusion-LM commit 759889d58ef3 and classified as medium 6.5. Affected is the text_sample.py sampling component of the improved-diffusion subproject. The manipulation of the argument out_dir in the checkpoint sidecar training_args.json leads to a path traversal file write. It is possible to launch the attack remotely. User interaction is required because the victim must run the documented batch_decode.py decode workflow on a malicious checkpoint.
Technical Details
- Affected file/function: improved-diffusion/scripts/text_sample.py / main(), and improved-diffusion/scripts/batch_decode.py
- Vulnerable parameter: out_dir inside the checkpoint sidecar training_args.json
- Attack vector: Network
- Privileges required: None
- Trigger condition: text_sample.py merges the JSON sidecar over its parsed CLI arguments (keeping only batch_size), then writes .npz/.txt/.json artifacts through os.path.join(args.out_dir, ...) and open(..., 'w'); batch_decode.py hardcodes the safe output directory generation_outputs, so the victim cannot see or constrain the real output directory and artifacts land in any absolute path chosen by the checkpoint author.
Impact
- Confidentiality: None (no victim data is read or exfiltrated)
- Integrity: High (files with attacker-controlled directory and vocabulary-derived content are created outside the victim-specified directory; existing files with the predictable artifact names can be overwritten)
- Availability: None (the parent process crashes after the fact, but no availability impact on other services)
CVSS v3.1
Score: 6.5 (Medium)
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
Assumption note: Integrity is set to High because the checkpoint author fully controls both the target directory and the file content; the artifact file names follow a fixed pattern.
Timeline
- Discovered: 2026-10-19
- Vendor notified: [pending]
- Patch released: [pending]
- Public disclosure: [pending]
Countermeasure
Stop merging checkpoint-sidecar values over execution-affecting CLI arguments: load training_args.json only for the model-architecture keys consumed by create_model_and_diffusion, keep CLI precedence for out_dir/model_path/data_dir, and validate that resolved output paths stay inside the command-line-specified directory. |
|---|
| 来源 | ⚠️ https://github.com/XiangLi1999/Diffusion-LM/issues/80 |
|---|
| 用户 | Dem000 (UID 98389) |
|---|
| 提交 | 2026-10-21 09時38分 (1 月前) |
|---|
| 管理 | 2026-11-19 22時56分 (30 days later) |
|---|
| 状态 | 已接受 |
|---|
| VulDB条目 | 440907 [XiangLi1999 Diffusion-LM 直到 759889d58ef38e2eed41a8c34db8032e072826f4 text_sample.py main out_dir 目录遍历] |
|---|
| 积分 | 20 |
|---|