CVE-2021-37678 | Arbitrary 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](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/python/keras/saving/model_config.py#L66-L104) 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: 2021-08-12 Last update: 2024-11-21 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2021-37678 is rated Moderate Risk (64.1/100): CVSS Critical severity, with medium exploitation likelihood (EPSS 1.02%). Mandatory action: Review affected assets and schedule remediation.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2021-37678

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-03-25 1.08% 1.02% -0.06%
2 2026-03-21 1.02% 1.08% +0.06%
3 2026-02-05 1.02%

Full EPSS history (21 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2021-37678

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
9.3 3.1 CRITICAL
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H Click to expand
Attack vector (AV:L)
They already need access on the box, or another person has to do something wrong; it’s not a remote drive-by.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.5 6.0 [email protected]
8.8 3.1 HIGH
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H Click to expand
Attack vector (AV:L)
They already need access on the box, or another person has to do something wrong; it’s not a remote drive-by.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.0 6.0 [email protected]
4.6 2.0 MEDIUM
AV:L/AC:L/Au:N/C:P/I:P/A:P Click to expand
Access vector (AV:L)
Requires local access to the target system.
Access complexity (AC:L)
Exploitation conditions are straightforward and predictable.
Authentication (AU:N)
No authentication is required.
Confidentiality impact (C:P)
Partial confidentiality impact.
Integrity impact (I:P)
Partial integrity impact.
Availability impact (A:P)
Partial availability impact.
3.9 6.4 [email protected]

Weakness enumeration for CVE-2021-37678

GitHub Security Advisory for CVE-2021-37678

GHSA-r6jx-9g48-2r5r · Severity: high · Ecosystem: pip — Arbitrary code execution due to YAML deserialization

OS Trackers for CVE-2021-37678

vendor priority summary link
debian unimportant CVE-2021-37678 unimportant priority: Debian including 1 source packages (tensorflow), 2 status rows across 2 suites (forky, sid): resolved 2. https://security-tracker.debian.org/tracker/CVE-2021-37678

Affected software / configurations for CVE-2021-37678

Vendor Product Version Raw CPE
google tensorflow >= 2.3.0, < 2.3.4 cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*
google tensorflow >= 2.4.0, < 2.4.3 cpe:2.3:a:google:tensorflow:*:*:*:*:*:*:*:*
google tensorflow 2.5.0 cpe:2.3:a:google:tensorflow:2.5.0:*:*:*:*:*:*:*
google tensorflow 2.6.0 cpe:2.3:a:google:tensorflow:2.6.0:rc0:*:*:*:*:*:*
google tensorflow 2.6.0 cpe:2.3:a:google:tensorflow:2.6.0:rc1:*:*:*:*:*:*
google tensorflow 2.6.0 cpe:2.3:a:google:tensorflow:2.6.0:rc2:*:*:*:*:*:*

References for CVE-2021-37678

cvelogic Threat Intelligence