Live Exposure Defense: From CVE to Confirmed Exposure in 12 Hours – See more

New CVE Detected

CVE-2025-31114 – Remote Code Execution via Unsafe eval() – Fooocus ≤ 2.5.5

Be the first to know when new zero-days emerge:

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 — including get_list(), get_resolution(), get_adm_guidance(), and get_freeu() — call Python’s eval() directly on untrusted metadata dictionary values (styles, resolution, adm_guidance, and freeu entries) 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 as json.loads() or ast.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.

References

Are you exposed?

Get a free report of your organization’s exposure to this CVE and threat

How IONIX’s External Exposure Management Platform Detects and Validates
Zero-Days to Shrink MTTR

1

Map your entire attack surface (continously)

IONIX uses multi-factor discovery methods, including DNS analysis, certificate mapping, metadata inspection, and more, to automatically map every internet-facing asset across your environment. This includes cloud instances, third-party platforms, shadow IT, and even forgotten infrastructure that traditional tools miss.

2

Monitor for new CVEs

Dozens of threat intel feeds using agentic technology are continuously analyzed to detect the appearance of proof-of-concept code, exploit kits, and indicators of active targeting. IONIX goes further by applying AI to proactively evaluate whether emerging vulnerabilities are likely to be exploited, even before PoCs go public.

3

Identify Potential External Exposures

Not all CVEs matter. IONIX filters vulnerabilities by asking attacker-centric questions: Can it be reached from the internet? Does it require authentication? Is it being exploited in the wild? This dramatically reduces noise and focuses teams on threats that can actually be weaponized.

4

Create Safe, Scalable Exploit Validations

IONIX transforms real-world PoCs into safe, non-intrusive test payloads that can be run in production environments without disruption. These simulations are precisely targeted to the systems that are vulnerable, ensuring rapid validation without unnecessary load.

5

Execute Exploit Validations

By combining context about software stack, versioning, exposure status, and reachability, IONIX ensures that only the right payloads are executed against the right assets, maximizing efficiency and minimizing risk.

6

Drive Fast and Actionable Remediation

Results are routed through integrations with ticketing, SOAR, and SIEM tools. Issues are written in plain language, bundled into remediation clusters, and prioritized based on asset criticality, exploitability, and blast radius. This shortens mean time to remediation (MTTR) and empowers teams to act with confidence.

Are you exposed?

Get a free report of your organization’s exposure to this CVE and threat

Subscribe to Threat Center RSS

Copy/paste the link below into your preferred RSS reader or follow these instructions to subscribe to Slack alerts.

Get Real-Time CVE Alerts to Your Email

Be the first to know when new zero-days emerge