Downloads · 30 days
0
pragnyanramtha/rllib-msgpack-numpy-object-array-ace-poc
rllib-msgpack-numpy-object-array-ace-poc is a machine learning model from pragnyanramtha. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as other.
This repository stages a safe proof-of-concept for a MessagePack-based ML checkpoint loading issue. The artifact is a tiny state.msgpack file that follows the Ray RLlib checkpoint state-file shape and carries a NumPy…
Downloads · 30 days
0
Access
Public
Updated May 12, 2026
Repo size
506 B
Likes
0
Public
Click a slice to open those files.
.py6.4 KB · 38%
From the Hugging Face model README
This repository stages a safe proof-of-concept for a MessagePack-based ML checkpoint loading issue. The artifact is a tiny state.msgpack file that follows the Ray RLlib checkpoint state-file shape and carries a NumPy object-dtype array encoded through msgpack-numpy.
When decoded through Ray RLlib's restore_from_path() MessagePack path, the current msgpack-numpy decoder reaches pickle.loads() for object-dtype array data. The embedded payload only writes a local marker file named MSG_PACK_NUMPY_MARKER.txt.
Public PoC URL: https://huggingface.co/pragnyanramtha/rllib-msgpack-numpy-object-array-ace-poc
state.msgpack - benign PoC checkpoint state file.verify_poc.py - verifies plain MessagePack parsing, direct msgpack-numpy parsing, and Ray RLlib restore behavior.build_poc.py - reproduces the artifact generation.artifact_manifest.json - SHA256, size, and marker details.results.json - local verification output.scanner_output_file.json - ModelScan 0.8.8 output for state.msgpack.scanner_output_dir.json - ModelScan 0.8.8 output for this staged folder.requirements.txt - pinned reproduction dependencies used for this validation.python -m venv .venv
.venv/Scripts/python -m pip install -r requirements.txt
.venv/Scripts/python build_poc.py
.venv/Scripts/python verify_poc.py
.venv/Scripts/modelscan -p state.msgpack -r json -o scanner_output_file.json --show-skipped
On Linux/macOS, replace .venv/Scripts/python with .venv/bin/python.
Expected behavior:
msgpack.load() parses the file as data and does not create the marker.msgpack_numpy.load() creates MSG_PACK_NUMPY_MARKER.txt.Checkpointable.restore_from_path() creates MSG_PACK_NUMPY_MARKER.txt.total_scanned: 0 and skips state.msgpack as SCAN_NOT_SUPPORTED.Artifact:
SHA256: 3ddf739096ea87558f341e1705b607510e7e7f3af4c37841b51bd8809b52e465
Size: 506 bytes
Runtime:
"ray_rllib_restore_check": {
"restored_keys": ["format", "object_array", "safe_weights"],
"object_array_type": "ndarray",
"object_array_repr": "array([34], dtype=object)",
"marker_created": true,
"marker_text": "msgpack_numpy_object_array_marker\n"
}
Scanner:
"scanned": {"total_scanned": 0},
"skipped": {
"total_skipped": 1,
"skipped_files": [{
"category": "SCAN_NOT_SUPPORTED",
"description": "Model Scan did not scan file",
"source": "state.msgpack"
}]
}
Ray RLlib documents checkpoints as model/training artifacts that can be saved to local disk or cloud storage and restored through restore_from_path() / from_checkpoint(). The docs state that checkpoint directories contain a pickle or msgpack state file, and current RLlib source loads state.msgpack with a msgpack module patched by msgpack-numpy.
Primary references:
state.msgpack restore and try_import_msgpack: https://docs.ray.io/en/latest/_modules/ray/rllib/utils/checkpoints.htmlAn attacker-controlled RLlib .msgpack checkpoint state file can trigger arbitrary Python execution when a victim restores the checkpoint through RLlib's MessagePack path. This PoC uses a harmless local marker write, but the primitive is Python pickle execution hidden inside a MessagePack/NumPy serialization layer.
Limitations:
msgpack-numpy..msgpack artifact, not a claim that every Hugging Face scanner accepts the file as clean.msgpack_numpy.patch() for untrusted checkpoint data, or make the object-dtype pickle path opt-in only..msgpack model artifacts that recursively detects nested pickle payloads in msgpack-numpy object-array records.