# CVE-2022-29210: Heap buffer overflow due to incorrect hash function in TensorFlow

- Severity: Medium 5.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.23%, higher than 14% of CVEs (2026-12-01)
- Published: 2022-05-20T23:25:21.000Z
- Modified: 2026-09-08T08:48:20.499Z
- Also known as: GHSA-hc2f-7r5r-r2hg, BIT-TENSORFLOW-2022-29210, PYSEC-2026-1007, PYSEC-2026-3200, PYSEC-2026-3339
- Weaknesses: CWE-120, CWE-122, CWE-787
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- tensorflow tensorflow: == 2.8.0
- tensorflow (PyPI): from 2.8.0 before 2.8.1
- tensorflow-cpu (PyPI): from 2.8.0 before 2.8.1
- tensorflow-gpu (PyPI): from 2.8.0 before 2.8.1
- google tensorflow: 2.8.0
- tensorflow (Bitnami): from 2.8.0 before 2.8.1

## Every score

- GitHub_M: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:2.0 2.1 Low `AV:L/AC:L/Au:N/C:N/I:N/A:P`
- PyPA Advisory Database: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://github.com/tensorflow/tensorflow/releases/tag/v2.8.1> (advisory, release-notes, third-party-advisory, web)
- <https://github.com/tensorflow/tensorflow/releases/tag/v2.9.0> (advisory, release-notes, third-party-advisory, web)
- <https://github.com/tensorflow/tensorflow/security/advisories/GHSA-hc2f-7r5r-r2hg> (advisory, patch, third-party-advisory, web)
- <https://github.com/tensorflow/tensorflow/commit/1b85a28d395dc91f4d22b5f9e1e9a22e92ccecd6> (advisory, patch, third-party-advisory, web)
- <https://github.com/tensorflow/tensorflow/blob/f3b9bf4c3c0597563b289c0512e98d4ce81f886e/tensorflow/core/framework/tensor_key.h#L53-L64> (advisory, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-29210> (advisory, web)
- <https://github.com/tensorflow/tensorflow> (package)
- <https://pypi.org/project/tensorflow-gpu> (package)
- <https://github.com/advisories/GHSA-hc2f-7r5r-r2hg> (advisory)
- <https://pypi.org/project/tensorflow> (package)
- <https://pypi.org/project/tensorflow-cpu> (package)

## Sources

- CVE List: [CVE-2022-29210](https://www.cve.org/CVERecord?id=CVE-2022-29210), CVE Terms of Use, modified 2025-04-23
- GitHub Advisory Database: [GHSA-hc2f-7r5r-r2hg](https://github.com/advisories/GHSA-hc2f-7r5r-r2hg), CC-BY-4.0, modified 2026-07-13
- NVD: [CVE-2022-29210](https://nvd.nist.gov/vuln/detail/CVE-2022-29210), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1007](https://osv.dev/vulnerability/PYSEC-2026-1007), CC-BY-4.0, modified 2026-07-13
- PyPA Advisory Database: [PYSEC-2026-3200](https://osv.dev/vulnerability/PYSEC-2026-3200), CC-BY-4.0, modified 2026-07-13
- PyPA Advisory Database: [PYSEC-2026-3339](https://osv.dev/vulnerability/PYSEC-2026-3339), CC-BY-4.0, modified 2026-07-13
- Bitnami Vulnerability Database: [BIT-TENSORFLOW-2022-29210](https://osv.dev/vulnerability/BIT-TENSORFLOW-2022-29210), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2022-29210 · Whole record: https://cve.day/CVE-2022-29210.json · Rebuilt by cve.day 2026-11-25T22:58:11.880Z
