Downloads · 30 days
0
rez0/safetensors-cpp-integer-overflow-poc
safetensors-cpp-integer-overflow-poc is a machine learning model from rez0. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Security Research - Responsible Disclosure via huntr
Downloads · 30 days
0
Access
Public
Updated Feb 24, 2026
Repo size
128 B
Likes
0
Public
Click a slice to open those files.
.cc10.6 KB · 41%
From the Hugging Face model README
Security Research - Responsible Disclosure via huntr
safetensors-cpp get_shape_size() multiplies shape dimensions without overflow checking.
The Rust reference implementation uses checked_mul and rejects overflow.
Shape [4194305, 4194305, 211106198978564] overflows uint64 to 4.
Parser allocates 16 bytes, consumer iterates 4194305+ elements -> heap overflow.
AddressSanitizer: heap-buffer-overflow WRITE of size 4
0x6020000001a0 is located 0 bytes after 16-byte region
python3 craft_overflow.py
g++ -std=c++17 -DSAFETENSORS_CPP_IMPLEMENTATION -fsanitize=address -I safetensors-cpp -o crash crash_overflow.cc
./crash overflow_tensor.safetensors