onnxruntime
4c40a4ec - Add validation of onnx::TensorProto data size before allocation (#27547)

Commit
19 days ago
Add validation of onnx::TensorProto data size before allocation (#27547) ### Description - Embedded initializers: Adds validation to ensure that the size of an initializer, as indicated by its shape and type, is consistent with the amount of data embedded in the TensorProto. - Embedded initializers: Adds check to ensure that initializers embedded in an ONNX model do not exceed 2GiB in size. - External initializers: Adds validation to ensure that external files are large enough to contain an external initializer's data. ### Motivation and Context Prevents ORT from attempting to allocate a large amount of data (OoM) due to a malicious model that contains a tensor with large dimensions, but with no actual data (or a small amount of data inconsistent with the shape).
Parents
Loading