Views
No views yet
xml_deserialize_util.cpp.overflow_model.xml - Crafted IR model with overflow offset/size in Const layeroverflow_model.bin - Minimal weights file (256 bytes)1import openvino as ov
2core = ov.Core()
3model = core.read_model("overflow_model.xml", "overflow_model.bin")
4# Triggers integer overflow: offset(0xFFFFFFFFFFFFFF00) + size(0x200) = 0x100
5# Bounds check passes (0x100 <= 256), but offset is far out of boundsm_weights->size() < offset + size uses unchecked addition.
With offset=0xFFFFFFFFFFFFFF00 and size=0x200, the sum wraps to 0x100 (256),
which equals the .bin file size, so the check passes.
The subsequent get_ptr<char>() + offset creates an out-of-bounds pointer.offset + size with overflow-safe check:1if (offset > m_weights->size() || size > m_weights->size() - offset)
2 OPENVINO_THROW("Incorrect weights in bin file!");