CVE-2021-37641:Buffer overflow vulnerability in TensorFlow's RaggedGather operation allows for out-of-bounds memory access.

splash
Back

Description Preview

CVE-2021-37641 affects TensorFlow, an open-source machine learning platform. The vulnerability exists in the tf.raw_ops.RaggedGather operation where improper validation of input arguments can lead to out-of-bounds memory access. The implementation reads the first dimension of a tensor shape without first verifying that the tensor has a rank of at least 1 (not a scalar). Additionally, it fails to check if the params_nested_splits list is empty. This could lead to heap buffer overflows, potentially allowing attackers to read sensitive memory data or cause application crashes.

Overview

This vulnerability affects multiple versions of TensorFlow before the patched releases. The issue occurs in the RaggedGather operation implementation where insufficient validation of tensor shapes and ranks allows for out-of-bounds memory access. When the arguments to tf.raw_ops.RaggedGather don't determine a valid ragged tensor, the code can read from outside the bounds of heap-allocated buffers. This happens because the implementation directly accesses the first dimension of a tensor shape without first checking if the tensor has a sufficient rank, and also fails to verify that params_nested_splits contains tensors. This vulnerability could potentially be exploited to cause denial of service or information disclosure.

Remediation

Users should upgrade to one of the following patched versions:

  • TensorFlow 2.6.0 or later
  • TensorFlow 2.5.1 or later
  • TensorFlow 2.4.3 or later
  • TensorFlow 2.3.4 or later

If upgrading is not immediately possible, users should avoid using the tf.raw_ops.RaggedGather operation with untrusted inputs. The fix was implemented in GitHub commit a2b743f6017d7b97af1fe49087ae15f0ac634373, which adds proper validation checks for tensor ranks and ensures the params_nested_splits list is not empty before attempting to access elements.

References

  • Patch: https://github.com/tensorflow/tensorflow/commit/a2b743f6017d7b97af1fe49087ae15f0ac634373
  • GitHub Security Advisory: https://github.com/tensorflow/tensorflow/security/advisories/GHSA-9c8h-vvrj-w2p8
  • Affected versions: TensorFlow versions before 2.6.0, 2.5.1, 2.4.3, and 2.3.4

Industry ExposureMost to least
This section illustrates the prevalence of a specific Common Vulnerabilities and Exposures (CVE) across various industries based on customer reports. The ranking displays industries from the most to least affected by this particular vulnerability, offering valuable insight into where this CVE has been most frequently observed. This information can help organizations within these sectors prioritize their security efforts, understand their relative risk exposure compared to their peers, and focus remediation strategies where they are most needed. By understanding the industry-specific impact, organizations can make more informed decisions regarding patching, resource allocation, and overall risk management related to this CVE.

  1. Manufacturing
    Manufacturing
  2. Finance and Insurance
    Finance and Insurance
  3. Management of Companies & Enterprises
    Management of Companies & Enterprises
  4. Retail Trade
    Retail Trade
  5. Arts, Entertainment & Recreation
    Arts, Entertainment & Recreation
  6. Professional, Scientific, & Technical Services
    Professional, Scientific, & Technical Services
  7. Public Administration
    Public Administration
  8. Transportation & Warehousing
    Transportation & Warehousing
  9. Accommodation & Food Services
    Accommodation & Food Services
  10. Administrative, Support, Waste Management & Remediation Services
    Administrative, Support, Waste Management & Remediation Services
  11. Agriculture, Forestry Fishing & Hunting
    Agriculture, Forestry Fishing & Hunting
  12. Construction
    Construction
  13. Educational Services
    Educational Services
  14. Health Care & Social Assistance
    Health Care & Social Assistance
  15. Information
    Information
  16. Mining
    Mining
  17. Other Services (except Public Administration)
    Other Services (except Public Administration)
  18. Real Estate Rental & Leasing
    Real Estate Rental & Leasing
  19. Utilities
    Utilities
  20. Wholesale Trade
    Wholesale Trade

Focus on What Matters

  1. See Everything.
  2. Identify True Risk.
  3. Proactively Mitigate Threats.

Let's talk!

background