Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-111237 Overview
CVE-2026-111237 is a code injection vulnerability [CWE-94] in Ultralytics FastSAM up to commit b4ed20c2fed75eadc5aa7d8b09fedd137b873b52. The flaw resides in the session.get_modelmeta.custom_metadata_map function within ultralytics/nn/autobackend.py, part of the AutoBackend Model Loading component. Attackers with local access can manipulate the imgsz, names, or kpt_shape arguments to achieve improper neutralization of directives in dynamically evaluated code. FastSAM uses a rolling release model, so no fixed version identifier is available. The project maintainers were notified through a public issue report but have not responded.
Critical Impact
Local attackers can inject code through model metadata fields processed by FastSAM's AutoBackend, leading to arbitrary code execution within the host Python process.
Affected Products
- Ultralytics FastSAM up to commit b4ed20c2fed75eadc5aa7d8b09fedd137b873b52
- The ultralytics/nn/autobackend.py module (AutoBackend Model Loading component)
- Downstream applications embedding FastSAM for inference workloads
Discovery Timeline
- 2026-10-16 - CVE-2026-111237 published to NVD
- 2026-10-21 - Last updated in NVD database
Technical Details for CVE-2026-111237
Vulnerability Analysis
The vulnerability sits in the AutoBackend model loading path, specifically in the custom_metadata_map handling tied to session.get_modelmeta. When FastSAM loads a model, it reads metadata fields such as imgsz (image size), names (class names), and kpt_shape (keypoint shape) and converts the string representations into Python objects. The conversion relies on dynamic evaluation of attacker-controllable strings rather than safe parsers such as ast.literal_eval or structured deserializers. As a result, metadata embedded in a model file can carry Python expressions that execute during load.
Root Cause
The root cause is improper neutralization of directives in dynamically evaluated code [CWE-94]. Metadata values that originate from the loaded model file are passed to an evaluation routine without validation of type, structure, or content. Any expression supplied through imgsz, names, or kpt_shape is executed with the privileges of the process invoking FastSAM.
Attack Vector
Exploitation requires local access and low privileges, with no user interaction. An attacker crafts a malicious model artifact containing poisoned metadata and places it where FastSAM will load it, for example a shared model cache, a user project directory, or a path referenced by an inference script. When the application calls the AutoBackend loader, the embedded expression executes. The vulnerability is well suited to supply-chain scenarios where models are shared across data science teams or pulled from untrusted registries.
See the public GitHub Issue #288 and the VulDB CVE-2026-111237 record for additional technical context. No verified public exploit code is available at this time.
Stop Remote Code Execution Before It Runs
Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.
Stop Exploit AttemptsDetection Methods for CVE-2026-111237
Indicators of Compromise
- Unexpected Python child processes spawned by scripts that import ultralytics or FastSAM modules
- Model files whose metadata fields imgsz, names, or kpt_shape contain Python expressions, function calls, or dunder references such as __import__
- Outbound network connections initiated by inference workers shortly after model load
- New files written to user or system directories by processes running FastSAM inference
Detection Strategies
- Scan model repositories for metadata fields containing characters outside the expected numeric or list syntax before deployment
- Enable Python audit hooks (sys.addaudithook) around compile, exec, and eval calls in environments that load third-party models
- Correlate process-tree telemetry from inference hosts to flag Python interpreters launching shells, package managers, or network utilities
Monitoring Recommendations
- Log every model load event with the source path, SHA-256 digest, and uploader identity
- Monitor data-science workstations and MLOps runners for anomalous process lineage descending from Python inference jobs
- Alert on changes to shared model caches and registry buckets that host FastSAM artifacts
How to Mitigate CVE-2026-111237
Immediate Actions Required
- Restrict FastSAM model loading to models produced and signed by trusted internal pipelines
- Isolate inference workloads in least-privilege containers or sandboxes with no outbound network access by default
- Audit existing model stores for files containing executable expressions in imgsz, names, or kpt_shape metadata
- Remove or quarantine any FastSAM model whose provenance cannot be verified
Patch Information
No vendor patch is available. The maintainers of Ultralytics FastSAM have not responded to the public issue report referenced in GitHub Issue #288. Because the project uses a rolling release model, specific fixed version information is not published. Track the upstream repository and the VulDB vulnerability record for updates.
Workarounds
- Replace dynamic evaluation with ast.literal_eval in local forks of ultralytics/nn/autobackend.py for imgsz, names, and kpt_shape parsing
- Load models only from read-only, access-controlled storage with integrity checks such as SHA-256 verification
- Run FastSAM inference under a dedicated service account with no interactive shell and no write access to shared paths
- Apply operating-system level allowlisting to block Python processes from executing unexpected binaries
# Configuration example: run FastSAM in a locked-down container
docker run --rm \
--read-only \
--network=none \
--cap-drop=ALL \
--security-opt=no-new-privileges \
--user 10001:10001 \
-v /srv/models/trusted:/models:ro \
fastsam-inference:pinned \
python infer.py --weights /models/fastsam-x.pt
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

