Skip to content
Noroxi
NVD / CVE Program· CNA GitHub_M

CVE-2021-37678: Arbitrary code execution due to YAML deserialization

HighCVSS 8.8 · v3.1—Proof of concept Fix available

Noroxi assessment

Priority: Monitor (action score 35/100)

  • Public proof-of-concept code exists (GitHub); there is no record of exploitation in the wild.
  • Probability of exploitation in the next 30 days: 0.44% (FIRST EPSS).
  • Someone with local access to the system can trigger it. A low-privileged account is enough. No user action is required. No special conditions are required; it is repeatable.
  • Fixed version: tensorflow (PyPI) 2.3.4, 2.4.3, 2.5.1; tensorflow-cpu (PyPI) 2.3.4, 2.4.3, 2.5.1; tensorflow-gpu (PyPI) 2.3.4, 2.4.3, 2.5.1.

Low priority for now. Upgrade to tensorflow (PyPI) 2.3.4, 2.4.3, 2.5.1; tensorflow-cpu (PyPI) 2.3.4, 2.4.3, 2.5.1; tensorflow-gpu (PyPI) 2.3.4, 2.4.3, 2.5.1 or later.

Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it

Primary sources: NVD · CVE.org · FIRST EPSS

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
Aug 12, 2021
Updated
Jun 17, 2026
EPSS
0.4% · 39th percentile

Report tools

JSON

Action score

35

Monitor

Low priority for now.

CVSS
35 / 40 · 8.8 / 10
CISA KEV
0 / 30 · Not listed
EPSS
0 / 30 · 0.4%

CNA vs NVD score

NVD
8.8
CNA · GitHub_M
9.3
0.5 point gap

CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.

Get told when this record changes

  • Not in KEV: no record of exploitation in the wild
  • Proof of concept exists, no weaponized module
  • A fix has been released

If any of these changes, we'll tell you in the daily email digest.

Follow CVE-2021-37678

When you'll hear from us

  • when it enters CISA KEV
  • when exploit code appears or is weaponized
  • when the record is updated (including a fixed version)
  • when EPSS rises 20 points in a week

One daily email digest (06:00 UTC); connect a webhook for KEV listings and weaponized exploits every 10 minutes on paid plans, on the hour on the free plan.

Your free account also gets you

  • CVE alerts: add the products and versions you run, get the new CVEs that affect them
  • Uptime monitoring: 1 site, instant email when it goes down
  • Add your domain: subdomains and takeover risk scanned every week (1 domain)
  • 10 scans an hour on the security tools, at most 30 a day (3 a day without an account), an API key and MCP
  • All your scans in one panel: findings, what changed in the last scan, a report per domain or per client (PDF, share link)
All free tools

Sign up with email · Have an account? Sign in

Free account, no card. Unfollow any time.

Is your version affected? Check it

Noroxi analysis

What does it mean in your environment?

The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.

We use this product, ask for help

Affected systems

Is your version affected?

Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.

VendorProduct
googletensorflow

Versions reported by the vendor

Affected version ranges reported by the assigning authority (GitHub_M). Independent of NVD's CPE analysis and usually ahead of it.

  • tensorflow tensorflow

    • >= 2.5.0, < 2.5.1, >= 2.4.0, < 2.4.3, < 2.3.4affected

Package-level exposure

OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.

EcosystemPackageAffected rangeFix
PyPItensorflowfrom 2.3.0 · before 2.3.42.3.4
PyPItensorflowfrom 2.4.0 · before 2.4.32.4.3
PyPItensorflowfrom 2.5.0 · before 2.5.12.5.1
PyPItensorflowbefore 2.3.42.3.4
PyPItensorflow-cpufrom 2.3.0 · before 2.3.42.3.4
PyPItensorflow-cpufrom 2.4.0 · before 2.4.32.4.3
PyPItensorflow-cpufrom 2.5.0 · before 2.5.12.5.1
PyPItensorflow-cpubefore 2.3.42.3.4
PyPItensorflow-gpufrom 2.3.0 · before 2.3.42.3.4
PyPItensorflow-gpufrom 2.4.0 · before 2.4.32.4.3
PyPItensorflow-gpufrom 2.5.0 · before 2.5.12.5.1
PyPItensorflow-gpubefore 2.3.42.3.4

Other highest-scoring records for the same primary product.

  • CVE-2023-25668TensorFlow vulnerable to heap out-of-buffer read in the QuantizeAndDequantize operation
    39Monitor
  • CVE-2023-25664TensorFlow vulnerable to Heap Buffer Overflow in AvgPoolGrad
    39Monitor
  • CVE-2022-41900FractionalMaxPool and FractionalAVGPool heap out-of-bounds acess in Tensorflow
    39Monitor

Published before and after this one in the same product

  • ← EarlierCVE-2021-37674Aug 12, 2021 · Incomplete validation in `MaxPoolGrad` in TensorFlow
    22Monitor
  • ← EarlierCVE-2021-37677Aug 12, 2021 · Missing validation in shape inference for `Dequantize` in TensorFlow
    22Monitor
  • Later →CVE-2021-37679Aug 12, 2021 · Heap OOB in nested `tf.map_fn` with `RaggedTensor`s in TensorFlow
    31Monitor

Remediation

Which version to upgrade to

Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.

Product / packageFixed versionSource
PyPI:tensorflow2.3.4Package registry (OSV)
PyPI:tensorflow2.4.3Package registry (OSV)
PyPI:tensorflow2.5.1Package registry (OSV)
PyPI:tensorflow-cpu2.3.4Package registry (OSV)
PyPI:tensorflow-cpu2.4.3Package registry (OSV)
PyPI:tensorflow-cpu2.5.1Package registry (OSV)
PyPI:tensorflow-gpu2.3.4Package registry (OSV)
PyPI:tensorflow-gpu2.4.3Package registry (OSV)
PyPI:tensorflow-gpu2.5.1Package registry (OSV)

Exploit status

Proof of concept available

A public proof of concept or detection signature exists. Exploit knowledge is out there; don't delay patching.

Evidence

  • Proof-of-concept repository on GitHub ×1

Noroxi does not host or link to exploit code. Metasploit module names and Nuclei template ids are shown (names, not code); Exploit-DB entries and PoC repositories are given as counts only.

Public exploit evidence
SourceKindDate
Proof-of-concept repository on GitHubstars:22021-09-09

Research context

For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.

Timeline

From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.

  1. Published
  2. First PoC+27 d
  3. TodayNov 13, 2026+1918 d

Patch and commit links

Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.

Not on record for this CVE: EPSS history · researcher credit · variant or chain candidate · public bounty program.

Technical details

Attack conditions

  • Someone with local access to the system can trigger it.
  • A low-privileged account is enough.
  • No user action is required.
  • No special conditions are required; it is repeatable.

If successful

Confidentiality
high · data can be read
Integrity
high · data or configuration can be modified
Availability
high · the service can be disrupted

Impact can extend beyond the vulnerable component (scope changes).

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality impact
High
Integrity impact
High
Availability impact
High

CVSS vector

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

nvd-primary

Root cause

Data received over the network is deserialized into the language’s native object format without verifying its source. Code paths inside the object can be triggered during deserialization.

A representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.

Vulnerable

python
payload = sock.recv(65536)job = pickle.loads(payload)

Fixed

python
payload = sock.recv(65536)if not hmac.compare_digest(sign(payload), header_sig):    raise PermissionError("invalid signature")job = JobSchema.validate(json.loads(payload))

Attack context

MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.

ATT&CK techniques

—

References

Show all references (1 more)

Vendor advisories and official records. Exploit/PoC links are deliberately left out.

All records