Executive brief
TensorFlow is a popular machine learning framework used by researchers and organizations to build and train neural networks. The TensorSummaryV2 operation in TensorFlow lacks proper input validation, allowing an attacker to provide crafted arguments that cause the application to crash and deny service to other users. This vulnerability affects applications that expose TensorFlow operations to untrusted input sources.
Technical details
The tf.raw_ops.TensorSummaryV2 operation does not validate that the `serialized_summary_metadata` input parameter is a scalar tensor before calling `.scalar<tstring>()()` on it. An attacker can pass a non-scalar tensor (such as an empty array) which causes a CHECK-failure assertion and crashes the process. The vulnerability requires the attacker to be able to call TensorFlow operations directly, which typically means network or local access to a system running TensorFlow with exposed APIs. The issue is a missing input validation (CWE-20) that enables denial of service. Patches are available in TensorFlow 2.6.4, 2.7.2, 2.8.1, and 2.9.0+.
Affected products
- Google TensorFlow 0.x through 2.6.3, 2.7.0-2.7.1, 2.8.0
- Google TensorFlow-CPU 1.15.0, 2.1.0 through 2.6.3, 2.7.0-2.7.1, 2.8.0
- Google TensorFlow-GPU 1.15.0, 2.1.0 through 2.6.3, 2.7.0-2.7.1, 2.8.0
Timeline
- 2022-05-20: disclosed
- 2022-05-24: patched: Fix committed to main branch (commit 290bb05c80c327ed74fae1d089f1001b1e2a4ef7)
- 2022-06: patched: Patches released in TensorFlow 2.6.4, 2.7.2, 2.8.1, and 2.9.0