CVE-2021-41220
HIGH 7.8CVSS 3.1Use after free / memory leak in `CollectiveReduceV2`
TensorFlow is an open source platform for machine learning. In affected versions the async implementation of CollectiveReduceV2 suffers from a memory leak and a use after free. This occurs due to the asynchronous computation and the fact that objects that have been std::move()d from are still accessed. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, as this version is the only one that is also affected.
- Published
- 5 Nov 2021
- Last modified
- 8 Jul 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-416
- Also known as
- BIT-tensorflow-2021-41220GHSA-gpfh-jvf9-7wg5PYSEC-2021-412PYSEC-2021-629PYSEC-2021-827
- Sources
- NVDJSONOSV GHSA-gpfh-jvf9-7wg5JSONOSV PYSEC-2021-412JSONOSV PYSEC-2021-629JSONOSV PYSEC-2021-827JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 4.6 | AV:L/AC:L/Au:N/C:P/I:P/A:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | tensorflowcpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:* |
>= 2.6.0, < 2.6.1 | 2.6.1 | |
| NVD | tensorflowcpe:2.3:a:google:tensorflow:2.7.0:rc0:*:*:*:*:*:* |
= 2.7.0 | ||
| NVD | tensorflowcpe:2.3:a:google:tensorflow:2.7.0:rc1:*:*:*:*:*:* |
= 2.7.0 | ||
| OSV | PyPI | tensorflow | >= 2.6.0, < 2.6.1 | 2.6.1 |
| OSV | PyPI | tensorflow-cpu | >= 2.6.0, < 2.6.1 | 2.6.1 |
| OSV | PyPI | tensorflow-gpu | >= 2.6.0, < 2.6.1 | 2.6.1 |
| OSV | PyPI | tensorflow | >= 2.6.0, < 2.6.1; >= 2.7.0rc0, < 2.7.0 | 2.6.1, 2.7.0 |
| OSV | PyPI | tensorflow-cpu | >= 2.6.0, < 2.6.1; >= 2.7.0rc0, < 2.7.0 | 2.6.1, 2.7.0 |
| OSV | PyPI | tensorflow-gpu | >= 2.6.0, < 2.6.1; >= 2.7.0rc0, < 2.7.0 | 2.6.1, 2.7.0 |
References
- https://github.com/tensorflow/tensorflow/commit/ca38dab9d3ee66c5de06f11af9a4b1200da5ef75 · Patch, Third Party Advisory, WEB, FIX
- https://github.com/tensorflow/tensorflow/security/advisories/GHSA-gpfh-jvf9-7wg5 · Exploit, Patch, Third Party Advisory, WEB, ADVISORY
- https://nvd.nist.gov/vuln/detail/CVE-2021-41220 · ADVISORY
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-629.yaml · WEB
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-827.yaml · WEB
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-412.yaml · WEB
- https://github.com/tensorflow/tensorflow · PACKAGE
History
- 25 Nov 2026 20:33 UTC · NVD: first stored (published 5 Nov 2021)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 5 Nov 2021)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 5 Nov 2021)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 5 Nov 2021)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 10 Nov 2021)