CVE-2021-37678
HIGH 8.8CVSS 3.1Arbitrary code execution due to YAML deserialization
TensorFlow is an end-to-end open source platform for machine learning. In affected versions TensorFlow and Keras can be tricked to perform arbitrary code execution when deserializing a Keras model from YAML format. The implementation uses yaml.unsafe_load which can perform arbitrary code execution on the input. Given that YAML format support requires a significant amount of work, we have removed it for now. We have patched the issue in GitHub commit 23d6383eb6c14084a8fc3bdf164043b974818012. 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.
- Published
- 12 Aug 2021
- Last modified
- 8 Jul 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-502
- Also known as
- BIT-tensorflow-2021-37678GHSA-r6jx-9g48-2r5rPYSEC-2021-300PYSEC-2021-591PYSEC-2021-789
- Sources
- NVDJSONOSV GHSA-r6jx-9g48-2r5rJSONOSV PYSEC-2021-300JSONOSV PYSEC-2021-591JSONOSV PYSEC-2021-789JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N | |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | CRITICAL 9.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | CRITICAL 9.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 8.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/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.3.0, < 2.3.4 | 2.3.4 | |
| NVD | tensorflowcpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:* |
>= 2.4.0, < 2.4.3 | 2.4.3 | |
| NVD | tensorflowcpe:2.3:a:google:tensorflow:2.5.0:*:*:*:*:*:*:* |
= 2.5.0 | ||
| NVD | tensorflowcpe:2.3:a:google:tensorflow:2.6.0:rc0:*:*:*:*:*:* |
= 2.6.0 | ||
| NVD | tensorflowcpe:2.3:a:google:tensorflow:2.6.0:rc1:*:*:*:*:*:* |
= 2.6.0 | ||
| NVD | tensorflowcpe:2.3:a:google:tensorflow:2.6.0:rc2:*:*:*:*:*:* |
= 2.6.0 | ||
| OSV | PyPI | tensorflow | < 2.3.4 | 2.3.4 |
| OSV | PyPI | tensorflow | >= 2.4.0, < 2.4.3 | 2.4.3 |
| OSV | PyPI | tensorflow | >= 2.5.0, < 2.5.1 | 2.5.1 |
| OSV | PyPI | tensorflow-cpu | < 2.3.4 | 2.3.4 |
| OSV | PyPI | tensorflow-cpu | >= 2.4.0, < 2.4.3 | 2.4.3 |
| OSV | PyPI | tensorflow-cpu | >= 2.5.0, < 2.5.1 | 2.5.1 |
| OSV | PyPI | tensorflow-gpu | < 2.3.4 | 2.3.4 |
| OSV | PyPI | tensorflow-gpu | >= 2.4.0, < 2.4.3 | 2.4.3 |
| OSV | PyPI | tensorflow-gpu | >= 2.5.0, < 2.5.1 | 2.5.1 |
| OSV | PyPI | tensorflow | >= 2.3.0, < 2.3.4; >= 2.4.0, < 2.4.3 | 2.3.4, 2.4.3 |
| OSV | PyPI | tensorflow-cpu | >= 2.3.0, < 2.3.4; >= 2.4.0, < 2.4.3 | 2.3.4, 2.4.3 |
| OSV | PyPI | tensorflow-gpu | >= 2.3.0, < 2.3.4; >= 2.4.0, < 2.4.3 | 2.3.4, 2.4.3 |
References
- https://github.com/tensorflow/tensorflow/commit/23d6383eb6c14084a8fc3bdf164043b974818012 · Patch, Third Party Advisory, WEB, FIX
- https://github.com/tensorflow/tensorflow/security/advisories/GHSA-r6jx-9g48-2r5r · Third Party Advisory, WEB, ADVISORY
- https://nvd.nist.gov/vuln/detail/CVE-2021-37678 · ADVISORY
- https://github.com/tensorflow/tensorflow/commit/1df5a69e9f1a18a937e7907223066e606bf466b9 · WEB
- https://github.com/tensorflow/tensorflow/commit/8e47a685785bef8f81bcb996048921dfde08a9ab · WEB
- https://github.com/tensorflow/tensorflow/commit/a09ab4e77afdcc6e1e045c9d41d5edab63aafc1a · WEB
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2021-591.yaml · WEB
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2021-789.yaml · WEB
- https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow/PYSEC-2021-300.yaml · WEB
- https://github.com/tensorflow/tensorflow · PACKAGE
History
- 25 Nov 2026 20:33 UTC · NVD: first stored (published 12 Aug 2021)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 12 Aug 2021)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 12 Aug 2021)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 12 Aug 2021)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 25 Aug 2021)