{"id":"CVE-2021-37692","published":"2021-08-12T23:00:14Z","modified":"2024-08-04T01:23:01Z","title":"Segfault on strings tensors with mistmatched dimensions in TensorFlow","vendor":"tensorflow","product":"tensorflow","tier":"tail","description":{"text":"TensorFlow is an end-to-end open source platform for machine learning. In affected versions under certain conditions, Go code can trigger a segfault in string deallocation. For string tensors, `C.TF_TString_Dealloc` is called during garbage collection within a finalizer function. However, tensor structure isn't checked until encoding to avoid a performance penalty. The current method for dealloc assumes that encoding succeeded, but segfaults when a string tensor is garbage collected whose encoding failed (e.g., due to mismatched dimensions). To fix this, the call to set the finalizer function is deferred until `NewTensor` returns and, if encoding failed for a string tensor, deallocs are determined based on bytes written. We have patched the issue in GitHub commit 8721ba96e5760c229217b594f6d2ba332beedf22. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, which is the other affected version.","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.00172,"percentile":0.06808,"provenance":"source"},"cwes":[{"id":"CWE-20","name":"Improper Input Validation"}],"references":[{"url":"https://github.com/tensorflow/tensorflow/security/advisories/GHSA-cmgw-8vpc-rc59","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/tensorflow/tensorflow/pull/50508","tags":["x_refsource_MISC"]},{"url":"https://github.com/tensorflow/tensorflow/commit/8721ba96e5760c229217b594f6d2ba332beedf22","tags":["x_refsource_MISC"]}],"priority":{"score":5.2,"factors":[{"name":"EPSS percentile","points":1.36},{"name":"CVSS severity","points":3.85}]},"vendorSlug":"tensorflow","affectedVersions":[{"vendor":"tensorflow","product":"tensorflow","versions":[">= 2.5.0, < 2.5.1"]}],"affected":[{"ecosystem":"PyPI","package":"tensorflow","vulnerableRanges":[">=2.5.0rc0, <2.5.1",">=2.3.0, <2.3.4",">=2.4.0, <2.4.3"],"patched":["2.5.1","2.3.4","2.4.3"],"from":["GHSA-cmgw-8vpc-rc59","PYSEC-2021-314"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-cpu","vulnerableRanges":[">=2.5.0rc0, <2.5.1",">=2.3.0, <2.3.4",">=2.4.0, <2.4.3"],"patched":["2.5.1","2.3.4","2.4.3"],"from":["GHSA-cmgw-8vpc-rc59","PYSEC-2021-605"],"provenance":"source"},{"ecosystem":"PyPI","package":"tensorflow-gpu","vulnerableRanges":[">=2.5.0rc0, <2.5.1",">=2.3.0, <2.3.4",">=2.4.0, <2.4.3"],"patched":["2.5.1","2.3.4","2.4.3"],"from":["GHSA-cmgw-8vpc-rc59","PYSEC-2021-803"],"provenance":"source"}],"summary":{"text":"A flaw in the Go bindings for TensorFlow, where string tensors with mismatched dimensions cause a segfault during garbage collection because the deallocation routine assumes encoding succeeded. An attacker with local access and low privileges can trigger a crash of the affected process, provided the program constructs a string tensor whose encoding fails, with no user interaction or special configuration required.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:19:51Z"},"euvd":{"id":"EUVD-2021-0418","exploited":false,"provenance":"source"}}