{"id":"CVE-2021-29514","published":"2021-05-14T19:36:25Z","modified":"2024-08-03T22:11:05Z","title":"Heap out of bounds write in `RaggedBinCount`","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an end-to-end open source platform for machine learning. If the `splits` argument of `RaggedBincount` does not specify a valid `SparseTensor`(https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor), then an attacker can trigger a heap buffer overflow. This will cause a read from outside the bounds of the `splits` tensor buffer in the implementation of the `RaggedBincount` op(https://github.com/tensorflow/tensorflow/blob/8b677d79167799f71c42fd3fa074476e0295413a/tensorflow/core/kernels/bincount_op.cc#L430-L446). Before the `for` loop, `batch_idx` is set to 0. The attacker sets `splits(0)` to be 7, hence the `while` loop does not execute and `batch_idx` remains 0. This then results in writing to `out(-1, bin)`, which is before the heap allocated buffer for the output 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 also affected.","provenance":"source","from":"CVE.org"},"cvss":{"score":2.5,"severity":"LOW","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00211,"percentile":0.0648,"provenance":"source"},"cwes":[{"id":"CWE-787","name":"Out-of-bounds Write"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/commit/eebb96c2830d48597d055d247c0e9aebaea94cd5","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-8h46-5m9h-7553","tags":["x_refsource_CONFIRM"]}],"priority":{"score":3.0,"factors":[{"name":"EPSS percentile","points":1.3},{"name":"CVSS severity","points":1.75}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":["< 2.3.3",">= 2.4.0, < 2.4.2"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":[">=2.3.0, <2.3.3",">=2.4.0, <2.4.2","<2.2.0rc0",">=2.2.0, <2.3.0rc0",">=2.3.0, <2.3.4",">=2.4.0, <2.4.3"],"patched":["2.3.3","2.4.2","2.2.0rc0","2.3.0rc0","2.3.4","2.4.3"],"from":["GHSA-8h46-5m9h-7553","PYSEC-2021-151"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":[">=2.3.0, <2.3.3",">=2.4.0, <2.4.2","<2.2.0rc0",">=2.2.0, <2.3.0rc0",">=2.3.0, <2.3.4",">=2.4.0, <2.4.3"],"patched":["2.3.3","2.4.2","2.2.0rc0","2.3.0rc0","2.3.4","2.4.3"],"from":["GHSA-8h46-5m9h-7553","PYSEC-2021-442"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":[">=2.3.0, <2.3.3",">=2.4.0, <2.4.2","<2.2.0rc0",">=2.2.0, <2.3.0rc0",">=2.3.0, <2.3.4",">=2.4.0, <2.4.3"],"patched":["2.3.3","2.4.2","2.2.0rc0","2.3.0rc0","2.3.4","2.4.3"],"from":["GHSA-8h46-5m9h-7553","PYSEC-2021-640"],"provenance":"source"}],"summary":{"text":"A heap out-of-bounds write exists in the RaggedBincount operation of TensorFlow, the open source machine learning platform, where an invalid splits argument that does not form a valid SparseTensor causes the implementation to write before the start of the output tensor's heap buffer. An attacker who can supply a crafted splits input to this operation can trigger the flaw, with the attack requiring local access, low privileges, and a high-complexity condition in which the attacker controls the splits values.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:22:39Z"},"euvd":{"id":"EUVD-2021-0255","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2020-15203","children":[{"from":"CVE-2021-29514","to":"CVE-2022-21737","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/bincount_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/eebb96c2830d48597d055d247c0e9aebaea94cd5","https://github.com/tensorflow/tensorflow/commit/7019ce4f68925fd01cdafde26f8d8c938f47e6f9"],"basis":"shared function","functions":["RaggedBincountOp"]}]},{"from":"CVE-2021-29514","to":"CVE-2022-35986","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/bincount_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/eebb96c2830d48597d055d247c0e9aebaea94cd5","https://github.com/tensorflow/tensorflow/commit/7a4591fd4f065f4fa903593bc39b2f79530a74b8"],"basis":"shared function","functions":["RaggedBincountOp"]}]}]}}