🇰🇷 한글 설명
macOS용 Docker Model Runner의 MLX 추론 백엔드가 config.json의 model_file 설정을 통해 모델 디렉토리 내의 임의 Python 파일을 무조건적으로 실행하는 취약점입니다. MLX-LM 라이브러리가 안전한 검증 없이 importlib를 사용하여 코드를 로드하므로, 공격자가 조작한 모델을 통해 Docker 호스트에서 임의의 코드를 실행할 수 있습니다.
💡 쉬운 설명
악성 코드가 포함된 인공지능 모델을 불러오기만 해도 컴퓨터가 해킹당할 수 있는 보안 결함입니다. 공격자가 만든 가짜 모델을 사용하면 해커가 사용자의 컴퓨터를 마음대로 조종할 수 있습니다.
🇺🇸 원문 (English)
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 model_file configuration field in config.json. When a model's config.json specifies a model_file pointing to a Python file, MLX-LM uses importlib to load and execute it with no trust_remote_code 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.
📍 영향받는 시스템
macOS용 Docker Model Runner (MLX inference backend 사용 버전)
⚔️ 공격 벡터
공격자가 제어하는 OCI 레지스트리에서 악성 모델을 내려받아 model-runner.docker.internal API를 호출하여 실행
🛡️ 대응 방법
Docker Desktop 및 관련 MLX 백엔드 구성 요소의 최신 보안 패치 적용 및 신뢰할 수 없는 모델 사용 금지
🔧 검증 코드
명령어 실행 결과 MLX-LM 라이브러리가 탐지되면 해당 취약점에 노출될 가능성이 있는 환경임을 의미합니다.
docker info | grep -i 'Docker Desktop' && python3 -c 'import mlx_lm; print("MLX-LM library detected")' 2>/dev/null