CVE-2021-37692: Segfault on strings tensors with mistmatched dimensions in TensorFlow

Published Aug 12, 2021
·
Updated

Impact Under certain conditions, Go code can trigger a segfault in string deallocation.

For string tensors, C.TFTStringDealloc 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.

Patches We have patched the issue in GitHub commit 8721ba96e5760c229217b594f6d2ba332beedf22 (merging #50508).

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.

For more information Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.

Attribution This vulnerability has been reported externally via a fixing PR.

Other sources

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.TFTStringDealloc 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.

Affected Software

4 affected componentsFixes available
pip/tensorflow-gpu>=2.5.0rc0<2.5.1
2.5.1
pip/tensorflow-cpu>=2.5.0rc0<2.5.1
2.5.1
pip/tensorflow>=2.5.0rc0<2.5.1
2.5.1
Google TensorFlow>=2.5.0<2.6.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/tensorflow-gpu to a version that resolves this vulnerability.

    Fixed in 2.5.1
  2. Upgrade

    Upgrade pip/tensorflow-cpu to a version that resolves this vulnerability.

    Fixed in 2.5.1
  3. Upgrade

    Upgrade pip/tensorflow to a version that resolves this vulnerability.

    Fixed in 2.5.1
  4. Upgrade

    Upgrade tensorflow to a version that resolves this vulnerability.

    Fixed in 2.6.0
  5. Upgrade

    Upgrade tensorflow to a version that resolves this vulnerability.

    Fixed in 2.5.1Patch 8721ba96e5760c229217b594f6d2ba332beedf22
  6. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch 8721ba96e5760c229217b594f6d2ba332beedf22

Event History

Aug 12, 2021
CVE Published
via MITRE·11:00 PM
Data Sourced
via MITRE·11:00 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Aug 25, 2021
Advisory Published
via GitHub·02:38 PM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2021-37692?

CVE-2021-37692 has a severity rating that requires attention, as it can lead to segmentation faults in Go code during string deallocation.

2

How do I fix CVE-2021-37692?

To fix CVE-2021-37692, upgrade to TensorFlow version 2.5.1 or later.

3

Which versions of TensorFlow are affected by CVE-2021-37692?

CVE-2021-37692 affects TensorFlow versions between 2.5.0 and 2.6.0.

4

What kind of issues does CVE-2021-37692 cause in TensorFlow?

CVE-2021-37692 can cause segmentation faults during garbage collection processes involving string tensors.

5

Is CVE-2021-37692 applicable to all TensorFlow installations?

No, CVE-2021-37692 specifically impacts installations using affected versions of TensorFlow, TensorFlow-GPU, and TensorFlow-CPU.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203