{"id":"CVE-2025-61784","published":"2025-10-07T19:01:40Z","modified":"2025-10-07T19:24:20Z","title":"LLaMA Factory's Chat API has Critical SSRF and LFI Vulnerabilities","vendor":"hiyouga","product":"LLaMA-Factory","tier":"tail","description":{"text":"LLaMA-Factory is a tuning library for large language models. Prior to version 0.9.4, a Server-Side Request Forgery (SSRF) vulnerability in the chat API allows any authenticated user to force the server to make arbitrary HTTP requests to internal and external networks. This can lead to the exposure of sensitive internal services, reconnaissance of the internal network, or interaction with third-party services. The same mechanism also allows for a Local File Inclusion (LFI) vulnerability, enabling users to read arbitrary files from the server's filesystem. The vulnerability exists in the `_process_request` function within `src/llamafactory/api/chat.py.` This function is responsible for processing incoming multimodal content, including images, videos, and audio provided via URLs. The function checks if the provided URL is a base64 data URI or a local file path (`os.path.isfile`). If neither is true, it falls back to treating the URL as a web URI and makes a direct HTTP GET request using `requests.get(url, stream=True).raw` without any validation or sanitization of the URL. Version 0.9.4 fixes the underlying issue.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.6,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00383,"percentile":0.33271,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"},{"id":"CWE-918","name":"Server-Side Request Forgery"}],"references":[{"url":"https://github.com/hiyouga/LLaMA-Factory/security/advisories/GHSA-527m-2xhr-j27g","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/hiyouga/LLaMA-Factory/commit/95b7188090a1018935c9dc072bfc97f24f1c96e9","tags":["x_refsource_MISC"]}],"priority":{"score":12.0,"factors":[{"name":"EPSS percentile","points":6.65},{"name":"CVSS severity","points":5.32}]},"vendorSlug":"hiyouga","affectedVersions":[{"vendor":"hiyouga","product":"LLaMA-Factory","versions":["< 0.9.4"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-10-07T19:24:17.811030Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"llamafactory","vulnerableRanges":["<0.9.4"],"patched":["0.9.4"],"from":["GHSA-527m-2xhr-j27g","PYSEC-2026-1573"],"provenance":"source"}],"summary":{"text":"LLaMA-Factory, a tuning library for large language models, contains a flaw in the chat API's _process_request function in src/llamafactory/api/chat.py, which processes multimodal URLs (images, videos, audio) and fetches any URL that is not a base64 data URI or a local file path without validating it. An attacker with network access and a valid user account can make the server issue arbitrary HTTP requests to internal and external hosts, probing internal services, and can also read arbitrary files from the server's filesystem through the same mechanism.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:52:12Z"},"euvd":{"id":"EUVD-2025-31881","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2024-52803","published":"2024-11-21","fixed":"0.9.1","kev":false},{"cve":"CVE-2025-46567","published":"2025-05-01","fixed":"0.9.3","kev":false,"link":{"from":"CVE-2025-46567","to":"CVE-2025-61784","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:llamafactory","fromFixed":"0.9.3","toFixed":"0.9.4","daysApart":159}]}},{"cve":"CVE-2025-61784","published":"2025-10-07","fixed":"0.9.4","kev":false}],"package":"PyPI:llamafactory"}}