CVE-2026-5843: Docker Model Runner container-to-host code execution via MLX-LM model_file importlib loading

Published May 22, 2026
·
Updated

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

3 affected components
Docker Docker Model Runner
All of the following
Docker Docker Desktop>=4.56.0<4.71.0
Apple macOS

Event History

May 22, 2026
CVE Published
via MITRE·07:28 PM
Data Sourced
via MITRE·07:28 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:16 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-5843?

The severity of CVE-2026-5843 is high, with a CVSS score of 8.2.

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.

3

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.

4

Is CVE-2026-5843 specific to certain operating systems?

Yes, CVE-2026-5843 specifically affects the Docker Model Runner on macOS.

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203