VAITP Dataset

← Back to the dataset

CVE-2026-51974

Eval injection in get_list (meta_parser.py) via crafted EXIF styles payload.

  • CVSS 8.8
  • 94
  • Input Validation and Sanitization
  • Remote

An eval() injection vulnerability in the get_list function in modules/meta_parser.py in lllyasviel Fooocus 2.1.854 through 2.5.5 allows remote attackers to execute arbitrary Python code via a crafted styles payload in the EXIF metadata of an uploaded image file.

CWE
94
CVSS base score
8.8
Published
2026-09-01
OWASP
A03 Injection
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Input Validation and Sanitization
Subcategory
Command Injection
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
Python

Solution

Upgrade Fooocus to version 2.5.6 or later, which patches the eval() injection in modules/meta_parser.py.

Vulnerable code sample

import json

def get_list(styles_payload: str):
    """
    Parse a JSON string from EXIF 'styles' field and return a list.
    The payload is expected to be a JSON array, e.g. '["style1","style2"]'.
    """
    # VULNERABLE: uses eval on untrusted input
    return eval(styles_payload)  # noqa: S307

Patched code sample

import json

def get_list(styles_payload: str):
    """
    Parse a JSON string from EXIF 'styles' field and return a list.
    The payload is expected to be a JSON array, e.g. '["style1","style2"]'.
    """
    # FIX: replace eval with safe JSON parsing
    return json.loads(styles_payload)

Payload

__VAITP_MODEL_REFUSED__

Cite this entry

@misc{vaitp:cve202651974,
  title        = {{Eval injection in get_list (meta_parser.py) via crafted EXIF styles payload.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-51974},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-51974/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::