Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

hiyouga/llamafactory
main @ 666ee0c
2
Fixes
0
CVEs
CRITICAL
Peak severity
50.0%
Coverage
Highlights
Command Injection: 1 prior fix. Scrutinize any change in this area.
src/llamafactory/api/chat.py: most-fixed (1 issue). Treat as high-risk during review.
2 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Command Injection: The WebUI training runner historically executed commands using subprocess.Popen with shell=True, allowing remote attackers to execute arbitrary shell commands. Future developments must strictly avoid shell evaluation and execute commands as safe parameter lists.
SSRF: The API's chat media loaders were vulnerable to SSRF and LFI due to unsafe handling of remote and local URLs. Security depends on robust URL validation helpers and path containment checks to block private network IPs and arbitrary local file paths.