{"id":"CVE-2022-29210","published":"2022-05-20T23:25:21Z","modified":"2025-04-23T18:23:44Z","title":"Heap buffer overflow due to incorrect hash function in TensorFlow","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an open source platform for machine learning. In version 2.8.0, the `TensorKey` hash function used total estimated `AllocatedBytes()`, which (a) is an estimate per tensor, and (b) is a very poor hash function for constants (e.g. `int32_t`). It also tried to access individual tensor bytes through `tensor.data()` of size `AllocatedBytes()`. This led to ASAN failures because the `AllocatedBytes()` is an estimate of total bytes allocated by a tensor, including any pointed-to constructs (e.g. strings), and does not refer to contiguous bytes in the `.data()` buffer. The discoverers could not use this byte vector anyway because types such as `tstring` include pointers, whereas they needed to hash the string values themselves. This issue is patched in Tensorflow versions 2.9.0 and 2.8.1.","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:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0023,"percentile":0.14113,"provenance":"source"},"cwes":[{"id":"CWE-120","name":"Buffer Copy without Checking Size of Input"},{"id":"CWE-122","name":"Heap-based Buffer Overflow"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/releases/tag/v2.8.1","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/releases/tag/v2.9.0","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-hc2f-7r5r-r2hg","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/1b85a28d395dc91f4d22b5f9e1e9a22e92ccecd6","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/blob/f3b9bf4c3c0597563b289c0512e98d4ce81f886e/tensorflow/core/framework/tensor_key.h#L53-L64","tags":["x_refsource_MISC"]}],"priority":{"score":6.7,"factors":[{"name":"EPSS percentile","points":2.82},{"name":"CVSS severity","points":3.85}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":["== 2.8.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2025-04-23T14:07:00.383813Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":[">=2.8.0, <2.8.1"],"patched":["2.8.1"],"from":["GHSA-hc2f-7r5r-r2hg","PYSEC-2026-3200"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":[">=2.8.0, <2.8.1"],"patched":["2.8.1"],"from":["GHSA-hc2f-7r5r-r2hg","PYSEC-2026-3339"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":[">=2.8.0, <2.8.1"],"patched":["2.8.1"],"from":["GHSA-hc2f-7r5r-r2hg","PYSEC-2026-1007"],"provenance":"source"}],"summary":{"text":"The TensorKey hash function in TensorFlow's core tensor handling uses a per-tensor allocated-bytes estimate and reads raw bytes from the tensor buffer, which does not correspond to contiguous memory for types such as tstring, leading to heap buffer overflows. Exploitation requires local access with low privileges and no user interaction, and the impact is limited to availability (a crash or denial of service).","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:16:44Z"},"euvd":{"id":"EUVD-2022-4120","exploited":false,"provenance":"source"}}