Heap-based buffer overflow in TensorFlow - CVE-2021-29542
Published: May 13, 2021 / Updated: May 4, 2026
TensorFlow
TensorFlow
Description
The vulnerability allows a remote attacker to cause a denial of service.
The vulnerability exists due to a heap-based buffer overflow in tf.raw_ops.StringNGrams when processing crafted input tensors. A remote attacker can pass crafted inputs to trigger a heap buffer overflow and cause a denial of service.
The issue occurs in corner cases where generated tokens contain only padding elements, causing the implementation to read data[-1] when num_tokens becomes 0.