{"id":"CVE-2021-37670","published":"2021-08-12T22:25:16Z","modified":"2024-08-04T01:23:01Z","title":"Heap OOB in `UpperBound` and `LowerBound` in TensorFlow","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can read from outside of bounds of heap allocated data by sending specially crafted illegal arguments to `tf.raw_ops.UpperBound`. The [implementation](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/core/kernels/searchsorted_op.cc#L85-L104) does not validate the rank of `sorted_input` argument. A similar issue occurs in `tf.raw_ops.LowerBound`. We have patched the issue in GitHub commit 42459e4273c2e47a3232cc16c4f4fff3b3a35c38. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00173,"percentile":0.06906,"provenance":"source"},"cwes":[{"id":"CWE-125","name":"Out-of-bounds Read"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-9697-98pf-4rw7","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/42459e4273c2e47a3232cc16c4f4fff3b3a35c38","tags":["x_refsource_MISC"]}],"priority":{"score":5.2,"factors":[{"name":"EPSS percentile","points":1.38},{"name":"CVSS severity","points":3.85}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":[">= 2.5.0, < 2.5.1",">= 2.4.0, < 2.4.3","< 2.3.4"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":["<2.3.4",">=2.4.0, <2.4.3",">=2.5.0, <2.5.1",">=2.3.0, <2.3.4"],"patched":["2.3.4","2.4.3","2.5.1"],"from":["GHSA-9697-98pf-4rw7","PYSEC-2021-292"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":["<2.3.4",">=2.4.0, <2.4.3",">=2.5.0, <2.5.1",">=2.3.0, <2.3.4"],"patched":["2.3.4","2.4.3","2.5.1"],"from":["GHSA-9697-98pf-4rw7","PYSEC-2021-583"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":["<2.3.4",">=2.4.0, <2.4.3",">=2.5.0, <2.5.1",">=2.3.0, <2.3.4"],"patched":["2.3.4","2.4.3","2.5.1"],"from":["GHSA-9697-98pf-4rw7","PYSEC-2021-781"],"provenance":"source"}],"summary":{"text":"The flaw is an out-of-bounds read on the heap in the UpperBound and LowerBound operations of TensorFlow, a machine learning platform, because their implementation does not validate the rank of the sorted_input argument. An attacker with local access and low privileges, who can supply crafted illegal arguments to tf.raw_ops.UpperBound or tf.raw_ops.LowerBound and needs no user interaction, can read data outside the bounds of heap-allocated memory.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:20:04Z"},"euvd":{"id":"EUVD-2021-0396","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-tensorflow-cve-2021-37670","children":[{"from":"CVE-2021-37670","to":"CVE-2022-35965","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/searchsorted_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/42459e4273c2e47a3232cc16c4f4fff3b3a35c38","https://github.com/tensorflow/tensorflow/commit/bce3717eaef4f769019fd18e990464ca4a2efeea"],"basis":"shared function","functions":["LowerBoundOp","UpperBoundOp"]}]},{"from":"CVE-2021-37670","to":"CVE-2023-33976","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["tensorflow/core/kernels/searchsorted_op.cc"],"commits":["https://github.com/tensorflow/tensorflow/commit/42459e4273c2e47a3232cc16c4f4fff3b3a35c38","https://github.com/tensorflow/tensorflow/commit/6fa05df43b00038b048f4f0e51ef522da6532fec","https://github.com/tensorflow/tensorflow/commit/915884fdf5df34aaedd00fc6ace33a2cfdefa586"],"basis":"shared function","functions":["LowerBoundOp","UpperBoundOp"]}]}]}}