Summary
CVE-2025-31114 is a critical remote code execution (RCE) vulnerability affecting Fooocus, an open-source AI image-generation web UI, in versions 2.5.5 and earlier. The flaw stems from unsafe use of Python’s eval() function when parsing image-generation metadata (e.g., parameters embedded in generated images), allowing an attacker with access to the web UI to execute arbitrary code on the underlying host. The issue carries a CVSS score of 9.3 (Critical) and was disclosed by GitHub Security Lab as GHSL-2024-196.
Technical details
- Root cause: Several functions in Fooocus’s
meta_parser.py— includingget_list(),get_resolution(),get_adm_guidance(), andget_freeu()— call Python’seval()directly on untrusted metadata dictionary values (styles,resolution,adm_guidance, andfreeuentries) without any sanitization. - Trigger path: These unsafe parsing functions are invoked by
load_parameter_button_click(), which is reachable from multiple points in the single-page web interface, including the "Load Parameters" button and the metadata import (trigger_metadata_import) functionality. - Attack vector: An attacker can craft an image file with malicious metadata embedded in its parameters and have it processed by a victim’s Fooocus instance (e.g., via upload or metadata import), triggering
eval()on attacker-controlled strings. - Impact: Successful exploitation results in arbitrary code execution on the server or system running the Fooocus instance, with no authentication or user interaction beyond normal UI use required — leading to full compromise of confidentiality, integrity, and availability.
Affected software
- Fooocus (lllyasviel/Fooocus) — version 2.5.5 and all prior versions
Severity
- CVSS Score: 9.3 (Critical)
- CVSS v4.0 Vector:
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - No CVSS v3.1 vector has been published for this CVE at the time of this writing.
Mitigation and recommended actions
- Immediate: As of publication, no official patched release of Fooocus has been made available. A community-submitted fix (pull request #4207) proposes replacing unsafe
eval()calls with safer parsing alternatives such asjson.loads()orast.literal_eval(). Security teams should monitor the upstream repository for an official release incorporating this fix and upgrade as soon as it becomes available. - Workarounds (no patch available):
- Restrict network access to Fooocus web UI instances to trusted internal users only; do not expose the UI directly to the internet.
- Disable or avoid using the metadata "Load Parameters" / metadata-import features when processing images from untrusted or external sources.
- Do not open, import, or process image files (and their embedded metadata) received from untrusted sources within a Fooocus instance.
- Consider running Fooocus in an isolated, sandboxed, or containerized environment with minimal privileges to limit the blast radius of potential code execution.

