llamafactory
Unified Efficient Fine-Tuning of 100+ LLMs
Activity
- Latest release
- 3mo ago
- Total releases
- 11
- Cadence
- ~2 months
- Last 12 months
- 2
Reach
- Stars
- —
Details
- License
- Apache-2.0
- First release
- May 16, 2024
| Version | Released | |
|---|---|---|
0.9.5
patch
| ||
0.9.4
patch
| ||
0.9.3
patch
2 CVEs
CVE-2025-61784
PYSEC-2026-1573
GHSA-527m-2xhr-j27g
Jul 07, 2026
LLaMA Factory's Chat API Contains Critical SSRF and LFI Vulnerabilities
7.6
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
Low
SummaryA 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. DetailsThe 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. Vulnerable Code Snippets in _process_request:
This vulnerable function is called by create_chat_completion_response and create_stream_chat_completion_response, which are in turn called by the public-facing /v1/chat/completions API endpoint in src/llamafactory/api/app.py. A user can craft a request to this endpoint containing a malicious URL in the messages payload to trigger the vulnerability. PoCTo reproduce the vulnerability, send a POST request to the /v1/chat/completions endpoint with a JSON payload containing a URL that points to an internal or controlled external service. Start the LLaMA Factory API server. Use curl to send the malicious request. The following example uses a URL pointing to the AWS metadata service, a common SSRF attack vector. SSRF Payload:
LFI Payload:
The server will make a request to the specified URL or read the specified local file. ImpactVulnerability Type: Server-Side Request Forgery (SSRF) and Local File Inclusion (LFI). Impacted Component: The API server, specifically the /v1/chat/completions endpoint. Who is impacted: Any user who can send requests to the chat API. The vulnerability allows an attacker to bypass firewalls and access internal network resources, query cloud metadata services for credentials, or read sensitive files on the server. The severity is critical. CreditsWenhao Wu, ChengGao, Alibaba Cloud Intelligence Security Team Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
Fixed in
0.9.4
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-53002
PYSEC-2026-1576
GHSA-xj56-p8mm-qmxj
Jul 07, 2026
LLaMA-Factory allows Code Injection through improper vhead_file safeguards
8.3
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
High
SummaryA critical remote code execution vulnerability was discovered during the Llama Factory training process. This vulnerability arises because the Note: In torch versions <2.6, the default setting is Affected VersionLlama Factory versions <=0.9.3 are affected by this vulnerability. Details
PoCSteps to Reproduce
The video demonstration of the vulnerability exploitation is available at the Google Drive Link ImpactExploitation of this vulnerability allows remote attackers to:
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
0.9.2
patch
3 CVEs
CVE-2025-61784
PYSEC-2026-1573
GHSA-527m-2xhr-j27g
Jul 07, 2026
LLaMA Factory's Chat API Contains Critical SSRF and LFI Vulnerabilities
7.6
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
Low
SummaryA 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. DetailsThe 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. Vulnerable Code Snippets in _process_request:
This vulnerable function is called by create_chat_completion_response and create_stream_chat_completion_response, which are in turn called by the public-facing /v1/chat/completions API endpoint in src/llamafactory/api/app.py. A user can craft a request to this endpoint containing a malicious URL in the messages payload to trigger the vulnerability. PoCTo reproduce the vulnerability, send a POST request to the /v1/chat/completions endpoint with a JSON payload containing a URL that points to an internal or controlled external service. Start the LLaMA Factory API server. Use curl to send the malicious request. The following example uses a URL pointing to the AWS metadata service, a common SSRF attack vector. SSRF Payload:
LFI Payload:
The server will make a request to the specified URL or read the specified local file. ImpactVulnerability Type: Server-Side Request Forgery (SSRF) and Local File Inclusion (LFI). Impacted Component: The API server, specifically the /v1/chat/completions endpoint. Who is impacted: Any user who can send requests to the chat API. The vulnerability allows an attacker to bypass firewalls and access internal network resources, query cloud metadata services for credentials, or read sensitive files on the server. The severity is critical. CreditsWenhao Wu, ChengGao, Alibaba Cloud Intelligence Security Team Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
Fixed in
0.9.4
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-53002
PYSEC-2026-1576
GHSA-xj56-p8mm-qmxj
Jul 07, 2026
LLaMA-Factory allows Code Injection through improper vhead_file safeguards
8.3
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
High
SummaryA critical remote code execution vulnerability was discovered during the Llama Factory training process. This vulnerability arises because the Note: In torch versions <2.6, the default setting is Affected VersionLlama Factory versions <=0.9.3 are affected by this vulnerability. Details
PoCSteps to Reproduce
The video demonstration of the vulnerability exploitation is available at the Google Drive Link ImpactExploitation of this vulnerability allows remote attackers to:
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-46567
PYSEC-2026-1574
GHSA-f2f7-gj54-6vpv
Jul 07, 2026
LLaMA-Factory Allows Arbitrary Code Execution via Unsafe Deserialization in Ilamafy_baichuan2.py
6.1
/ 10
Medium
Local
Low
Low
Required
Unchanged
High
Low
Low
DescriptionA critical vulnerability exists in the Attack VectorThis vulnerability is exploitable without authentication or privileges when a user is tricked into:
No elevated privileges are required. The user only needs to run the script with an attacker-supplied Impact
Proof of Concept (PoC)
An example of
➡️ Running this will execute the malicious payload and create a
Affected File(s)
Suggested Fix
Example patch:
Workarounds
ReferencesCreditsAffected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
Fixed in
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
0.9.1
patch
3 CVEs
CVE-2025-61784
PYSEC-2026-1573
GHSA-527m-2xhr-j27g
Jul 07, 2026
LLaMA Factory's Chat API Contains Critical SSRF and LFI Vulnerabilities
7.6
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
Low
SummaryA 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. DetailsThe 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. Vulnerable Code Snippets in _process_request:
This vulnerable function is called by create_chat_completion_response and create_stream_chat_completion_response, which are in turn called by the public-facing /v1/chat/completions API endpoint in src/llamafactory/api/app.py. A user can craft a request to this endpoint containing a malicious URL in the messages payload to trigger the vulnerability. PoCTo reproduce the vulnerability, send a POST request to the /v1/chat/completions endpoint with a JSON payload containing a URL that points to an internal or controlled external service. Start the LLaMA Factory API server. Use curl to send the malicious request. The following example uses a URL pointing to the AWS metadata service, a common SSRF attack vector. SSRF Payload:
LFI Payload:
The server will make a request to the specified URL or read the specified local file. ImpactVulnerability Type: Server-Side Request Forgery (SSRF) and Local File Inclusion (LFI). Impacted Component: The API server, specifically the /v1/chat/completions endpoint. Who is impacted: Any user who can send requests to the chat API. The vulnerability allows an attacker to bypass firewalls and access internal network resources, query cloud metadata services for credentials, or read sensitive files on the server. The severity is critical. CreditsWenhao Wu, ChengGao, Alibaba Cloud Intelligence Security Team Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
Fixed in
0.9.4
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-53002
PYSEC-2026-1576
GHSA-xj56-p8mm-qmxj
Jul 07, 2026
LLaMA-Factory allows Code Injection through improper vhead_file safeguards
8.3
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
High
SummaryA critical remote code execution vulnerability was discovered during the Llama Factory training process. This vulnerability arises because the Note: In torch versions <2.6, the default setting is Affected VersionLlama Factory versions <=0.9.3 are affected by this vulnerability. Details
PoCSteps to Reproduce
The video demonstration of the vulnerability exploitation is available at the Google Drive Link ImpactExploitation of this vulnerability allows remote attackers to:
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-46567
PYSEC-2026-1574
GHSA-f2f7-gj54-6vpv
Jul 07, 2026
LLaMA-Factory Allows Arbitrary Code Execution via Unsafe Deserialization in Ilamafy_baichuan2.py
6.1
/ 10
Medium
Local
Low
Low
Required
Unchanged
High
Low
Low
DescriptionA critical vulnerability exists in the Attack VectorThis vulnerability is exploitable without authentication or privileges when a user is tricked into:
No elevated privileges are required. The user only needs to run the script with an attacker-supplied Impact
Proof of Concept (PoC)
An example of
➡️ Running this will execute the malicious payload and create a
Affected File(s)
Suggested Fix
Example patch:
Workarounds
ReferencesCreditsAffected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
Fixed in
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
0.9.0
minor
4 CVEs
CVE-2025-61784
PYSEC-2026-1573
GHSA-527m-2xhr-j27g
Jul 07, 2026
LLaMA Factory's Chat API Contains Critical SSRF and LFI Vulnerabilities
7.6
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
Low
SummaryA 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. DetailsThe 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. Vulnerable Code Snippets in _process_request:
This vulnerable function is called by create_chat_completion_response and create_stream_chat_completion_response, which are in turn called by the public-facing /v1/chat/completions API endpoint in src/llamafactory/api/app.py. A user can craft a request to this endpoint containing a malicious URL in the messages payload to trigger the vulnerability. PoCTo reproduce the vulnerability, send a POST request to the /v1/chat/completions endpoint with a JSON payload containing a URL that points to an internal or controlled external service. Start the LLaMA Factory API server. Use curl to send the malicious request. The following example uses a URL pointing to the AWS metadata service, a common SSRF attack vector. SSRF Payload:
LFI Payload:
The server will make a request to the specified URL or read the specified local file. ImpactVulnerability Type: Server-Side Request Forgery (SSRF) and Local File Inclusion (LFI). Impacted Component: The API server, specifically the /v1/chat/completions endpoint. Who is impacted: Any user who can send requests to the chat API. The vulnerability allows an attacker to bypass firewalls and access internal network resources, query cloud metadata services for credentials, or read sensitive files on the server. The severity is critical. CreditsWenhao Wu, ChengGao, Alibaba Cloud Intelligence Security Team Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
Fixed in
0.9.4
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-53002
PYSEC-2026-1576
GHSA-xj56-p8mm-qmxj
Jul 07, 2026
LLaMA-Factory allows Code Injection through improper vhead_file safeguards
8.3
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
High
SummaryA critical remote code execution vulnerability was discovered during the Llama Factory training process. This vulnerability arises because the Note: In torch versions <2.6, the default setting is Affected VersionLlama Factory versions <=0.9.3 are affected by this vulnerability. Details
PoCSteps to Reproduce
The video demonstration of the vulnerability exploitation is available at the Google Drive Link ImpactExploitation of this vulnerability allows remote attackers to:
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-46567
PYSEC-2026-1574
GHSA-f2f7-gj54-6vpv
Jul 07, 2026
LLaMA-Factory Allows Arbitrary Code Execution via Unsafe Deserialization in Ilamafy_baichuan2.py
6.1
/ 10
Medium
Local
Low
Low
Required
Unchanged
High
Low
Low
DescriptionA critical vulnerability exists in the Attack VectorThis vulnerability is exploitable without authentication or privileges when a user is tricked into:
No elevated privileges are required. The user only needs to run the script with an attacker-supplied Impact
Proof of Concept (PoC)
An example of
➡️ Running this will execute the malicious payload and create a
Affected File(s)
Suggested Fix
Example patch:
Workarounds
ReferencesCreditsAffected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
Fixed in
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2024-52803
PYSEC-2026-1575
GHSA-hj3w-wrh4-44vp
Jul 07, 2026
LLama Factory Remote OS Command Injection Vulnerability
7.5
/ 10
High
Network
Low
None
None
Unchanged
High
None
None
SummaryA critical remote OS command injection vulnerability has been identified in the Llama Factory training process. This vulnerability arises from improper handling of user input, allowing malicious actors to execute arbitrary OS commands on the host system. The issue is caused by insecure usage of the Affected VersionLlama Factory versions <=0.9.0 are affected by this vulnerability. ImpactExploitation of this vulnerability allows attackers to:
This significantly increases the risk of data breaches and operational disruption. Root CauseThe vulnerability originates from the training process where the Vulnerable snippet:
Proof of Concept (PoC)Steps to Reproduce
Bad actors are able to execute any OS command as they want. Remediation RecommendationsAvoid using
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
Fixed in
0.9.1
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
0.8.3
patch
4 CVEs
CVE-2025-61784
PYSEC-2026-1573
GHSA-527m-2xhr-j27g
Jul 07, 2026
LLaMA Factory's Chat API Contains Critical SSRF and LFI Vulnerabilities
7.6
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
Low
SummaryA 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. DetailsThe 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. Vulnerable Code Snippets in _process_request:
This vulnerable function is called by create_chat_completion_response and create_stream_chat_completion_response, which are in turn called by the public-facing /v1/chat/completions API endpoint in src/llamafactory/api/app.py. A user can craft a request to this endpoint containing a malicious URL in the messages payload to trigger the vulnerability. PoCTo reproduce the vulnerability, send a POST request to the /v1/chat/completions endpoint with a JSON payload containing a URL that points to an internal or controlled external service. Start the LLaMA Factory API server. Use curl to send the malicious request. The following example uses a URL pointing to the AWS metadata service, a common SSRF attack vector. SSRF Payload:
LFI Payload:
The server will make a request to the specified URL or read the specified local file. ImpactVulnerability Type: Server-Side Request Forgery (SSRF) and Local File Inclusion (LFI). Impacted Component: The API server, specifically the /v1/chat/completions endpoint. Who is impacted: Any user who can send requests to the chat API. The vulnerability allows an attacker to bypass firewalls and access internal network resources, query cloud metadata services for credentials, or read sensitive files on the server. The severity is critical. CreditsWenhao Wu, ChengGao, Alibaba Cloud Intelligence Security Team Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
Fixed in
0.9.4
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-53002
PYSEC-2026-1576
GHSA-xj56-p8mm-qmxj
Jul 07, 2026
LLaMA-Factory allows Code Injection through improper vhead_file safeguards
8.3
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
High
SummaryA critical remote code execution vulnerability was discovered during the Llama Factory training process. This vulnerability arises because the Note: In torch versions <2.6, the default setting is Affected VersionLlama Factory versions <=0.9.3 are affected by this vulnerability. Details
PoCSteps to Reproduce
The video demonstration of the vulnerability exploitation is available at the Google Drive Link ImpactExploitation of this vulnerability allows remote attackers to:
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-46567
PYSEC-2026-1574
GHSA-f2f7-gj54-6vpv
Jul 07, 2026
LLaMA-Factory Allows Arbitrary Code Execution via Unsafe Deserialization in Ilamafy_baichuan2.py
6.1
/ 10
Medium
Local
Low
Low
Required
Unchanged
High
Low
Low
DescriptionA critical vulnerability exists in the Attack VectorThis vulnerability is exploitable without authentication or privileges when a user is tricked into:
No elevated privileges are required. The user only needs to run the script with an attacker-supplied Impact
Proof of Concept (PoC)
An example of
➡️ Running this will execute the malicious payload and create a
Affected File(s)
Suggested Fix
Example patch:
Workarounds
ReferencesCreditsAffected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
Fixed in
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2024-52803
PYSEC-2026-1575
GHSA-hj3w-wrh4-44vp
Jul 07, 2026
LLama Factory Remote OS Command Injection Vulnerability
7.5
/ 10
High
Network
Low
None
None
Unchanged
High
None
None
SummaryA critical remote OS command injection vulnerability has been identified in the Llama Factory training process. This vulnerability arises from improper handling of user input, allowing malicious actors to execute arbitrary OS commands on the host system. The issue is caused by insecure usage of the Affected VersionLlama Factory versions <=0.9.0 are affected by this vulnerability. ImpactExploitation of this vulnerability allows attackers to:
This significantly increases the risk of data breaches and operational disruption. Root CauseThe vulnerability originates from the training process where the Vulnerable snippet:
Proof of Concept (PoC)Steps to Reproduce
Bad actors are able to execute any OS command as they want. Remediation RecommendationsAvoid using
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
Fixed in
0.9.1
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
0.8.2
patch
4 CVEs
CVE-2025-61784
PYSEC-2026-1573
GHSA-527m-2xhr-j27g
Jul 07, 2026
LLaMA Factory's Chat API Contains Critical SSRF and LFI Vulnerabilities
7.6
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
Low
SummaryA 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. DetailsThe 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. Vulnerable Code Snippets in _process_request:
This vulnerable function is called by create_chat_completion_response and create_stream_chat_completion_response, which are in turn called by the public-facing /v1/chat/completions API endpoint in src/llamafactory/api/app.py. A user can craft a request to this endpoint containing a malicious URL in the messages payload to trigger the vulnerability. PoCTo reproduce the vulnerability, send a POST request to the /v1/chat/completions endpoint with a JSON payload containing a URL that points to an internal or controlled external service. Start the LLaMA Factory API server. Use curl to send the malicious request. The following example uses a URL pointing to the AWS metadata service, a common SSRF attack vector. SSRF Payload:
LFI Payload:
The server will make a request to the specified URL or read the specified local file. ImpactVulnerability Type: Server-Side Request Forgery (SSRF) and Local File Inclusion (LFI). Impacted Component: The API server, specifically the /v1/chat/completions endpoint. Who is impacted: Any user who can send requests to the chat API. The vulnerability allows an attacker to bypass firewalls and access internal network resources, query cloud metadata services for credentials, or read sensitive files on the server. The severity is critical. CreditsWenhao Wu, ChengGao, Alibaba Cloud Intelligence Security Team Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
Fixed in
0.9.4
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-53002
PYSEC-2026-1576
GHSA-xj56-p8mm-qmxj
Jul 07, 2026
LLaMA-Factory allows Code Injection through improper vhead_file safeguards
8.3
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
High
SummaryA critical remote code execution vulnerability was discovered during the Llama Factory training process. This vulnerability arises because the Note: In torch versions <2.6, the default setting is Affected VersionLlama Factory versions <=0.9.3 are affected by this vulnerability. Details
PoCSteps to Reproduce
The video demonstration of the vulnerability exploitation is available at the Google Drive Link ImpactExploitation of this vulnerability allows remote attackers to:
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-46567
PYSEC-2026-1574
GHSA-f2f7-gj54-6vpv
Jul 07, 2026
LLaMA-Factory Allows Arbitrary Code Execution via Unsafe Deserialization in Ilamafy_baichuan2.py
6.1
/ 10
Medium
Local
Low
Low
Required
Unchanged
High
Low
Low
DescriptionA critical vulnerability exists in the Attack VectorThis vulnerability is exploitable without authentication or privileges when a user is tricked into:
No elevated privileges are required. The user only needs to run the script with an attacker-supplied Impact
Proof of Concept (PoC)
An example of
➡️ Running this will execute the malicious payload and create a
Affected File(s)
Suggested Fix
Example patch:
Workarounds
ReferencesCreditsAffected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
Fixed in
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2024-52803
PYSEC-2026-1575
GHSA-hj3w-wrh4-44vp
Jul 07, 2026
LLama Factory Remote OS Command Injection Vulnerability
7.5
/ 10
High
Network
Low
None
None
Unchanged
High
None
None
SummaryA critical remote OS command injection vulnerability has been identified in the Llama Factory training process. This vulnerability arises from improper handling of user input, allowing malicious actors to execute arbitrary OS commands on the host system. The issue is caused by insecure usage of the Affected VersionLlama Factory versions <=0.9.0 are affected by this vulnerability. ImpactExploitation of this vulnerability allows attackers to:
This significantly increases the risk of data breaches and operational disruption. Root CauseThe vulnerability originates from the training process where the Vulnerable snippet:
Proof of Concept (PoC)Steps to Reproduce
Bad actors are able to execute any OS command as they want. Remediation RecommendationsAvoid using
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
Fixed in
0.9.1
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
0.8.1
patch
4 CVEs
CVE-2025-61784
PYSEC-2026-1573
GHSA-527m-2xhr-j27g
Jul 07, 2026
LLaMA Factory's Chat API Contains Critical SSRF and LFI Vulnerabilities
7.6
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
Low
SummaryA 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. DetailsThe 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. Vulnerable Code Snippets in _process_request:
This vulnerable function is called by create_chat_completion_response and create_stream_chat_completion_response, which are in turn called by the public-facing /v1/chat/completions API endpoint in src/llamafactory/api/app.py. A user can craft a request to this endpoint containing a malicious URL in the messages payload to trigger the vulnerability. PoCTo reproduce the vulnerability, send a POST request to the /v1/chat/completions endpoint with a JSON payload containing a URL that points to an internal or controlled external service. Start the LLaMA Factory API server. Use curl to send the malicious request. The following example uses a URL pointing to the AWS metadata service, a common SSRF attack vector. SSRF Payload:
LFI Payload:
The server will make a request to the specified URL or read the specified local file. ImpactVulnerability Type: Server-Side Request Forgery (SSRF) and Local File Inclusion (LFI). Impacted Component: The API server, specifically the /v1/chat/completions endpoint. Who is impacted: Any user who can send requests to the chat API. The vulnerability allows an attacker to bypass firewalls and access internal network resources, query cloud metadata services for credentials, or read sensitive files on the server. The severity is critical. CreditsWenhao Wu, ChengGao, Alibaba Cloud Intelligence Security Team Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
Fixed in
0.9.4
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-53002
PYSEC-2026-1576
GHSA-xj56-p8mm-qmxj
Jul 07, 2026
LLaMA-Factory allows Code Injection through improper vhead_file safeguards
8.3
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
High
SummaryA critical remote code execution vulnerability was discovered during the Llama Factory training process. This vulnerability arises because the Note: In torch versions <2.6, the default setting is Affected VersionLlama Factory versions <=0.9.3 are affected by this vulnerability. Details
PoCSteps to Reproduce
The video demonstration of the vulnerability exploitation is available at the Google Drive Link ImpactExploitation of this vulnerability allows remote attackers to:
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-46567
PYSEC-2026-1574
GHSA-f2f7-gj54-6vpv
Jul 07, 2026
LLaMA-Factory Allows Arbitrary Code Execution via Unsafe Deserialization in Ilamafy_baichuan2.py
6.1
/ 10
Medium
Local
Low
Low
Required
Unchanged
High
Low
Low
DescriptionA critical vulnerability exists in the Attack VectorThis vulnerability is exploitable without authentication or privileges when a user is tricked into:
No elevated privileges are required. The user only needs to run the script with an attacker-supplied Impact
Proof of Concept (PoC)
An example of
➡️ Running this will execute the malicious payload and create a
Affected File(s)
Suggested Fix
Example patch:
Workarounds
ReferencesCreditsAffected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
Fixed in
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2024-52803
PYSEC-2026-1575
GHSA-hj3w-wrh4-44vp
Jul 07, 2026
LLama Factory Remote OS Command Injection Vulnerability
7.5
/ 10
High
Network
Low
None
None
Unchanged
High
None
None
SummaryA critical remote OS command injection vulnerability has been identified in the Llama Factory training process. This vulnerability arises from improper handling of user input, allowing malicious actors to execute arbitrary OS commands on the host system. The issue is caused by insecure usage of the Affected VersionLlama Factory versions <=0.9.0 are affected by this vulnerability. ImpactExploitation of this vulnerability allows attackers to:
This significantly increases the risk of data breaches and operational disruption. Root CauseThe vulnerability originates from the training process where the Vulnerable snippet:
Proof of Concept (PoC)Steps to Reproduce
Bad actors are able to execute any OS command as they want. Remediation RecommendationsAvoid using
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
Fixed in
0.9.1
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
0.8.0
minor
4 CVEs
CVE-2025-61784
PYSEC-2026-1573
GHSA-527m-2xhr-j27g
Jul 07, 2026
LLaMA Factory's Chat API Contains Critical SSRF and LFI Vulnerabilities
7.6
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
Low
SummaryA 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. DetailsThe 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. Vulnerable Code Snippets in _process_request:
This vulnerable function is called by create_chat_completion_response and create_stream_chat_completion_response, which are in turn called by the public-facing /v1/chat/completions API endpoint in src/llamafactory/api/app.py. A user can craft a request to this endpoint containing a malicious URL in the messages payload to trigger the vulnerability. PoCTo reproduce the vulnerability, send a POST request to the /v1/chat/completions endpoint with a JSON payload containing a URL that points to an internal or controlled external service. Start the LLaMA Factory API server. Use curl to send the malicious request. The following example uses a URL pointing to the AWS metadata service, a common SSRF attack vector. SSRF Payload:
LFI Payload:
The server will make a request to the specified URL or read the specified local file. ImpactVulnerability Type: Server-Side Request Forgery (SSRF) and Local File Inclusion (LFI). Impacted Component: The API server, specifically the /v1/chat/completions endpoint. Who is impacted: Any user who can send requests to the chat API. The vulnerability allows an attacker to bypass firewalls and access internal network resources, query cloud metadata services for credentials, or read sensitive files on the server. The severity is critical. CreditsWenhao Wu, ChengGao, Alibaba Cloud Intelligence Security Team Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
Fixed in
0.9.4
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-53002
PYSEC-2026-1576
GHSA-xj56-p8mm-qmxj
Jul 07, 2026
LLaMA-Factory allows Code Injection through improper vhead_file safeguards
8.3
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
High
SummaryA critical remote code execution vulnerability was discovered during the Llama Factory training process. This vulnerability arises because the Note: In torch versions <2.6, the default setting is Affected VersionLlama Factory versions <=0.9.3 are affected by this vulnerability. Details
PoCSteps to Reproduce
The video demonstration of the vulnerability exploitation is available at the Google Drive Link ImpactExploitation of this vulnerability allows remote attackers to:
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-46567
PYSEC-2026-1574
GHSA-f2f7-gj54-6vpv
Jul 07, 2026
LLaMA-Factory Allows Arbitrary Code Execution via Unsafe Deserialization in Ilamafy_baichuan2.py
6.1
/ 10
Medium
Local
Low
Low
Required
Unchanged
High
Low
Low
DescriptionA critical vulnerability exists in the Attack VectorThis vulnerability is exploitable without authentication or privileges when a user is tricked into:
No elevated privileges are required. The user only needs to run the script with an attacker-supplied Impact
Proof of Concept (PoC)
An example of
➡️ Running this will execute the malicious payload and create a
Affected File(s)
Suggested Fix
Example patch:
Workarounds
ReferencesCreditsAffected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
Fixed in
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2024-52803
PYSEC-2026-1575
GHSA-hj3w-wrh4-44vp
Jul 07, 2026
LLama Factory Remote OS Command Injection Vulnerability
7.5
/ 10
High
Network
Low
None
None
Unchanged
High
None
None
SummaryA critical remote OS command injection vulnerability has been identified in the Llama Factory training process. This vulnerability arises from improper handling of user input, allowing malicious actors to execute arbitrary OS commands on the host system. The issue is caused by insecure usage of the Affected VersionLlama Factory versions <=0.9.0 are affected by this vulnerability. ImpactExploitation of this vulnerability allows attackers to:
This significantly increases the risk of data breaches and operational disruption. Root CauseThe vulnerability originates from the training process where the Vulnerable snippet:
Proof of Concept (PoC)Steps to Reproduce
Bad actors are able to execute any OS command as they want. Remediation RecommendationsAvoid using
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
Fixed in
0.9.1
References
Updated Jul 07, 2026 · Source: OSV.dev | ||
0.7.1
initial
4 CVEs
CVE-2025-61784
PYSEC-2026-1573
GHSA-527m-2xhr-j27g
Jul 07, 2026
LLaMA Factory's Chat API Contains Critical SSRF and LFI Vulnerabilities
7.6
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
Low
SummaryA 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. DetailsThe 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. Vulnerable Code Snippets in _process_request:
This vulnerable function is called by create_chat_completion_response and create_stream_chat_completion_response, which are in turn called by the public-facing /v1/chat/completions API endpoint in src/llamafactory/api/app.py. A user can craft a request to this endpoint containing a malicious URL in the messages payload to trigger the vulnerability. PoCTo reproduce the vulnerability, send a POST request to the /v1/chat/completions endpoint with a JSON payload containing a URL that points to an internal or controlled external service. Start the LLaMA Factory API server. Use curl to send the malicious request. The following example uses a URL pointing to the AWS metadata service, a common SSRF attack vector. SSRF Payload:
LFI Payload:
The server will make a request to the specified URL or read the specified local file. ImpactVulnerability Type: Server-Side Request Forgery (SSRF) and Local File Inclusion (LFI). Impacted Component: The API server, specifically the /v1/chat/completions endpoint. Who is impacted: Any user who can send requests to the chat API. The vulnerability allows an attacker to bypass firewalls and access internal network resources, query cloud metadata services for credentials, or read sensitive files on the server. The severity is critical. CreditsWenhao Wu, ChengGao, Alibaba Cloud Intelligence Security Team Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
Fixed in
0.9.4
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-53002
PYSEC-2026-1576
GHSA-xj56-p8mm-qmxj
Jul 07, 2026
LLaMA-Factory allows Code Injection through improper vhead_file safeguards
8.3
/ 10
High
Network
Low
Low
None
Unchanged
High
Low
High
SummaryA critical remote code execution vulnerability was discovered during the Llama Factory training process. This vulnerability arises because the Note: In torch versions <2.6, the default setting is Affected VersionLlama Factory versions <=0.9.3 are affected by this vulnerability. Details
PoCSteps to Reproduce
The video demonstration of the vulnerability exploitation is available at the Google Drive Link ImpactExploitation of this vulnerability allows remote attackers to:
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2025-46567
PYSEC-2026-1574
GHSA-f2f7-gj54-6vpv
Jul 07, 2026
LLaMA-Factory Allows Arbitrary Code Execution via Unsafe Deserialization in Ilamafy_baichuan2.py
6.1
/ 10
Medium
Local
Low
Low
Required
Unchanged
High
Low
Low
DescriptionA critical vulnerability exists in the Attack VectorThis vulnerability is exploitable without authentication or privileges when a user is tricked into:
No elevated privileges are required. The user only needs to run the script with an attacker-supplied Impact
Proof of Concept (PoC)
An example of
➡️ Running this will execute the malicious payload and create a
Affected File(s)
Suggested Fix
Example patch:
Workarounds
ReferencesCreditsAffected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
0.9.1
0.9.2
Fixed in
0.9.3
References
Updated Jul 07, 2026 · Source: OSV.dev
CVE-2024-52803
PYSEC-2026-1575
GHSA-hj3w-wrh4-44vp
Jul 07, 2026
LLama Factory Remote OS Command Injection Vulnerability
7.5
/ 10
High
Network
Low
None
None
Unchanged
High
None
None
SummaryA critical remote OS command injection vulnerability has been identified in the Llama Factory training process. This vulnerability arises from improper handling of user input, allowing malicious actors to execute arbitrary OS commands on the host system. The issue is caused by insecure usage of the Affected VersionLlama Factory versions <=0.9.0 are affected by this vulnerability. ImpactExploitation of this vulnerability allows attackers to:
This significantly increases the risk of data breaches and operational disruption. Root CauseThe vulnerability originates from the training process where the Vulnerable snippet:
Proof of Concept (PoC)Steps to Reproduce
Bad actors are able to execute any OS command as they want. Remediation RecommendationsAvoid using
Affected versions
0.7.1
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0
Fixed in
0.9.1
References
Updated Jul 07, 2026 · Source: OSV.dev |
