{"id":"CVE-2021-41213","published":"2021-11-05T22:10:11Z","modified":"2024-08-04T03:08:31Z","title":"Deadlock in mutually recursive `tf.function` objects","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00243,"percentile":0.09315,"provenance":"source"},"cwes":[{"id":"CWE-667","name":"Improper Locking"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-h67m-xg8f-fxcf","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/commit/afac8158d43691661ad083f6dd9e56f327c1dcb7","tags":["x_refsource_MISC"]}],"priority":{"score":5.7,"factors":[{"name":"EPSS percentile","points":1.86},{"name":"CVSS severity","points":3.85}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":[">= 2.6.0, < 2.6.1",">= 2.5.0, < 2.5.2","< 2.4.4"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":[">=2.6.0, <2.6.1",">=2.5.0, <2.5.2","<2.4.4",">=2.7.0rc0, <2.7.0"],"patched":["2.6.1","2.5.2","2.4.4","2.7.0"],"from":["GHSA-h67m-xg8f-fxcf","PYSEC-2021-405"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":[">=2.6.0, <2.6.1",">=2.5.0, <2.5.2","<2.4.4",">=2.7.0rc0, <2.7.0"],"patched":["2.6.1","2.5.2","2.4.4","2.7.0"],"from":["GHSA-h67m-xg8f-fxcf","PYSEC-2021-622"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":[">=2.6.0, <2.6.1",">=2.5.0, <2.5.2","<2.4.4",">=2.7.0rc0, <2.7.0"],"patched":["2.6.1","2.5.2","2.4.4","2.7.0"],"from":["GHSA-h67m-xg8f-fxcf","PYSEC-2021-820"],"provenance":"source"}],"summary":{"text":"A deadlock flaw in TensorFlow's tf.function API arises when two tf.function-decorated Python functions are mutually recursive, because the code uses a non-reentrant Lock object. An attacker with local access and low privileges can cause a denial of service by getting a user to load a model containing such mutually recursive functions and then invoking the recursive tf.function, with no user interaction required beyond that.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:15:37Z"},"euvd":{"id":"EUVD-2021-0435","exploited":false,"provenance":"source"}}