CVE-2021-29521: TensorFlow is an end-to-end open source platform for machine learning. Specifying a negative dense shape in `tf.raw_ops.
Summary
TensorFlow (an open source platform for machine learning) has a bug where passing a negative number in the dense shape parameter to `tf.raw_ops.SparseCountSparseOutput` causes a crash. This happens because the code assumes the shape values are always positive and doesn't validate them before using them to create a data structure, which violates the safety rules of the underlying `std::vector` (a list-like data structure in C++).
Solution / Mitigation
The fix will be included in TensorFlow 2.5.0. This commit will also be applied to TensorFlow 2.4.2 and TensorFlow 2.3.3. The solution ensures that the `dense_shape` argument is validated to be a valid tensor shape, meaning all elements must be non-negative.
Vulnerability Details
2.5(low)
EPSS: 0.0%
Classification
Taxonomy References
Affected Vendors
Related Issues
CVE-2022-29200: TensorFlow is an open source platform for machine learning. Prior to versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4, the implem
CVE-2021-29541: TensorFlow is an end-to-end open source platform for machine learning. An attacker can trigger a dereference of a null p
Original source: https://nvd.nist.gov/vuln/detail/CVE-2021-29521
First tracked: February 15, 2026 at 08:38 PM
Classified by LLM (prompt v3) · confidence: 95%