SecurityContext

CVE-2021-41213: TensorFlow - Race Condition

  • Cve: CVE-2021-41213
  • Name: TensorFlow - Race Condition
  • Description: TensorFlow is an open source platform for machine learning. In affected versions the code behind `tf.function` API can be made to deadlock when two `tf.function` decorated Python functions are mutually recursive. This occurs due to using a non-reentrant `Lock` Python object. Loading any model which contains mutually recursive functions is vulnerable. An attacker can cause denial of service by causing users to load such models and calling a recursive `tf.function`, although this is not a frequent scenario. The fix will be included in TensorFlow 2.7.0. We will also cherrypick this commit on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.
  • Impact: Attackers can cause denial of service by triggering deadlocks during model loading with recursive functions.
  • Remediation: Update to TensorFlow 2.7.0 or cherry-pick the fix on versions 2.6.1, 2.5.2, and 2.4.4.
  • Vulnerability type: race_condition
  • Vulnerability impact: denial_of_service
  • Requirement type: none
  • Labels source: projectdiscovery
  • Severity: medium
  • Cvss score: 5.5
  • Cvss vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
  • Epss score: 0.00243
  • Epss percentile: 0.15408
  • Assignee: [email protected]
  • Published at: 2021-11-05T23:15:08Z
  • Age in days: 1846
  • Modified at: 2026-06-17T04:08:06Z
  • Patch available: yes
  • References total: 2
  • Products total: 1
  • Oss: yes
  • Projects total: 1
  • Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2021-41213
  • Nvd status: modified
  • Checked, none or zero: known exploited entries, nuclei templates, public exploits total, public exploits capped, public exploits, rejected by nvd
  • Not known: requirements, hackerone

Cwe

IdName
CWE-667Improper Locking
CWE-662Improper Synchronization

References

UrlSourceTags
https://github.com/tensorflow/tensorflow/commit/afac8158d43691661ad083f6dd9e56f327c1dcb7nvdPatch, Third Party Advisory
https://github.com/tensorflow/tensorflow/security/advisories/GHSA-h67m-xg8f-fxcfnvdThird Party Advisory

Products

ProductAffectedPlatform boundSourcesUrl
google:tensorflow= 2.7.0 rc0; = 2.7.0 rc1; >= 2.6.0, < 2.6.1; >= 2.5.0, < 2.5.2; >= 2.4.0, < 2.4.4nonvd/v1/products/google/tensorflow

Projects

RepositoryLink kindsIndexedUrl
tensorflow/tensorflowcommit, fix, package, security_advisoryyes/v1/repositories/tensorflow/tensorflow

Index

  • Repositories: 347
  • Repositories high signal: 134
  • Packages: 3

Exploitation

  • Checked, none or zero: known exploited, known exploited by, exploitation seen, public exploit, public exploit count, initial access, remote, authentication required
  • Not known: known exploited since, vulncheck known exploited since, public exploit first date, nuclei template, initial access since, hackerone reports, exposed hosts