CVE-2026-5843: Docker Model Runner container-to-host code execution via MLX-LM model_file importlib loading
The MLX inference backend in Docker Model Runner on macOS uses the MLX-LM library, which unconditionally imports and executes arbitrary Python files from model directories via the modelfile configuration field in config.json. When a model's config.json specifies a modelfile pointing to a Python file, MLX-LM uses importlib to load and execute it with no trustremotecode gate or equivalent safety check. The MLX backend runs without sandboxing, resulting in arbitrary code execution on the Docker host as the Docker Desktop user.
Any container on the Docker network can trigger this by calling the model-runner.docker.internal API to pull a malicious model from an attacker-controlled OCI registry and request inference.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-5843?
The severity of CVE-2026-5843 is high, with a CVSS score of 8.2.
How does CVE-2026-5843 allow code execution?
CVE-2026-5843 enables code execution by allowing arbitrary Python files to be imported and executed from model directories through the model_file field in config.json.
How can I mitigate CVE-2026-5843?
To mitigate CVE-2026-5843, avoid using untrusted model_file configurations in your config.json or restrict access to model directories.
Is CVE-2026-5843 specific to certain operating systems?
Yes, CVE-2026-5843 specifically affects the Docker Model Runner on macOS.
What versions of Docker are affected by CVE-2026-5843?
CVE-2026-5843 affects the Docker Model Runner in Docker versions that utilize the vulnerable MLX-LM library.