Downloads · 30 days
0
0xiviel/poc-coremltools-rce
poc-coremltools-rce is a machine learning model from 0xiviel. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Apple's CoreMLTools library calls torch.load() without weightsonly=True at three locations in sensitivekmeans.py (lines 540, 549, 649).
Downloads · 30 days
0
Access
Public
Updated Feb 6, 2026
Repo size
305 B
Likes
0
Public
Click a slice to open those files.
.py8.8 KB · 74%
From the Hugging Face model README
Apple's CoreMLTools library calls torch.load() without weights_only=True at three locations in sensitive_k_means.py (lines 540, 549, 649).
The SKMPalettizer.compress(sensitivity_path=...) method accepts a user-controlled file path and loads it via torch.load() without the safety flag, allowing arbitrary code execution via pickle deserialization.
malicious_sensitivity.pt — Crafted PyTorch checkpoint that executes id when loaded (305 bytes)create_malicious_pt.py — Script to generate the malicious .pt filepoc_coremltools_rce.py — Full PoC demonstrating the vulnerability# Requires: pip install torch coremltools
python3 poc_coremltools_rce.py
# Or test just the torch.load part (no coremltools needed):
python3 poc_coremltools_rce.py --torch-only
This PoC only executes id to demonstrate code execution. No files are modified or deleted.