CVE-2025-61784 LLaMA Factory's Chat API has Critical SSRF and LFI Vulnerabilities

High 7.6 Published Updated

Authenticated users can exploit SSRF and LFI in the Chat API to access internal networks and read arbitrary server files.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-61784?

CVE-2025-61784 is a high-severity server-side request forgery vulnerability in hiyouga LLaMA-Factory, published on 7 Oct 2025. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

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.

Weakness: CWE-918, CWE-22

Which versions are affected by CVE-2025-61784?

3 open source packages ship an affected version, including llamafactory. It affects 1 product.

PackageAffectedFixed in
llamafactory PyPIAll versions0.9.4
llamafactory PyPIAll versions0.9.4
llamafactory PyPIAll versions0.9.4

Products include Hiyouga Llama-Factory.

How do I fix CVE-2025-61784?

Upgrade llamafactory to 0.9.4 or later.

Upgrade, and send outbound requests through an allow-list that blocks internal addresses. More about Server-side request forgery.

Is CVE-2025-61784 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-61784 exists.

Sources

Also known as GHSA-527m-2xhr-j27g, PYSEC-2026-1573.

Is CVE-2025-61784 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free