GHSL-2024-196: Remote Code Execution (RCE) in Fooocus webui - CVE-2025-31114
The Fooocus web UI uses Python's eval on metadata fields from uploaded images, allowing an attacker to execute arbitrary code. An attacker with access to the web UI could upload a crafted image to achieve remote code execution.
The Fooocus web UI is vulnerable to remote code execution due to the unsafe use of eval when processing metadata JSON. An attacker with access to the Fooocus web UI may be able to execute arbitrary code on the instance.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could execute arbitrary code on the Fooocus instance, leading to remote code execution.
What the attacker needed
Access to the Fooocus web UI; ability to upload an image file
The fix
The unsafe eval calls should be replaced with safe parsing methods such as ast.literal_eval or JSON parsing.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
The Fooocus web interface lets users upload images that contain extra information (metadata) such as the prompt used to create them. The program takes some of that metadata and runs it as Python code without checking it, so a malicious image can make the server run any command the attacker wants.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.