{"id":"CVE-2021-29607","published":"2021-05-14T19:21:03Z","modified":"2024-08-03T22:11:06Z","title":"Incomplete validation in `SparseSparseMinimum`","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_sparse_binary_op_shared.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.14538,"provenance":"source"},"cwes":[{"id":"CWE-754","name":"Improper Check for Unusual or Exceptional Conditions"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/commit/ba6822bd7b7324ba201a28b2f278c29a98edbef2","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-gv26-jpj9-c8gq","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/f6fde895ef9c77d848061c0517f19d0ec2682f3a","tags":["x_refsource_MISC"]}],"priority":{"score":6.6,"factors":[{"name":"EPSS percentile","points":2.91},{"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-gv26-jpj9-c8gq","PYSEC-2021-244"],"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-gv26-jpj9-c8gq","PYSEC-2021-535"],"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-gv26-jpj9-c8gq","PYSEC-2021-733"],"provenance":"source"}],"summary":{"text":"The TensorFlow sparse tensor binary operation code, in the sparse_sparse_binary_op_shared implementation used by SparseSparseMinimum, performs incomplete validation of its two sparse tensor inputs. An attacker who can supply crafted sparse tensor inputs to this operation can trigger null pointer dereferences and out-of-bounds heap writes, which requires the ability to submit input to a TensorFlow process running the affected operation.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:17:00Z"},"euvd":{"id":"EUVD-2021-0348","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2020-15202","children":[{"from":"CVE-2021-29607","to":"CVE-2023-25665","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/sparse_sparse_binary_op_shared.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/ba6822bd7b7324ba201a28b2f278c29a98edbef2","https://github.com/tensorflow/tensorflow/commit/f6fde895ef9c77d848061c0517f19d0ec2682f3a","https://github.com/tensorflow/tensorflow/commit/5e0ecfb42f5f65629fd7a4edd6c4afe7ff0feb04"],"basis":"shared function","functions":["SparseSparseBinaryOpShared"]}]}]}}