{"id":"CVE-2021-29609","published":"2021-05-14T19:20:52Z","modified":"2024-08-03T22:11:06Z","title":"Incomplete validation in `SparseAdd`","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an end-to-end open source platform for machine learning. Incomplete validation in `SparseAdd` results in allowing attackers to exploit undefined behavior (dereferencing null pointers) as well as write outside of bounds of heap allocated data. The implementation(https://github.com/tensorflow/tensorflow/blob/656e7673b14acd7835dc778867f84916c6d1cac2/tensorflow/core/kernels/sparse_add_op.cc) has a large set of validation for the two sparse tensor inputs (6 tensors in total), but does not validate that the tensors are not empty or that the second dimension of `*_indices` matches the size of corresponding `*_shape`. This allows attackers to send tensor triples that represent invalid sparse tensors to abuse code assumptions that are not protected by validation. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00234,"percentile":0.08607,"provenance":"source"},"cwes":[{"id":"CWE-665","name":"Improper Initialization"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-cjc7-49v2-jp64","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/41727ff06111117bdf86b37db198217fd7a143cc","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/commit/6fd02f44810754ae7481838b6a67c5df7f909ca3","tags":["x_refsource_MISC"]}],"priority":{"score":5.4,"factors":[{"name":"EPSS percentile","points":1.72},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":["< 2.1.4",">= 2.2.0, < 2.2.3",">= 2.3.0, < 2.3.3",">= 2.4.0, < 2.4.2"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2"],"from":["GHSA-cjc7-49v2-jp64","PYSEC-2021-246"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2"],"from":["GHSA-cjc7-49v2-jp64","PYSEC-2021-537"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":["<2.1.4",">=2.2.0, <2.2.3",">=2.3.0, <2.3.3",">=2.4.0, <2.4.2"],"patched":["2.1.4","2.2.3","2.3.3","2.4.2"],"from":["GHSA-cjc7-49v2-jp64","PYSEC-2021-735"],"provenance":"source"}],"summary":{"text":"The flaw is incomplete input validation in the SparseAdd operation of TensorFlow's core kernels, where the sparse tensor inputs are not checked to be non-empty or to have an indices second dimension that matches the corresponding shape size. An attacker who can supply a crafted sparse tensor triple to the affected operation, with local access and low privileges plus a high-complexity condition, can trigger null pointer dereferences and out-of-bounds heap writes, causing a crash or denial of service.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:17:00Z"},"euvd":{"id":"EUVD-2021-0350","exploited":false,"provenance":"source"}}