Skip to content
RCE Advisory Intermediate CVE-2025-31114

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.

Kwstubbs Follow

Originally disclosed on GitHub Security Lab

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.

Kwstubbs, on GitHub Security Lab

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.

More by Kwstubbs

View all

43 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.