Headline
CVE-2022-29213: `tf.compat.v1.signal.rfft2d` and `rfft3d` lacks input validation leading to crashes · Issue #55263 · tensorflow/tensorflow
TensorFlow is an open source platform for machine learning. Prior to versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4, the tf.compat.v1.signal.rfft2d
and tf.compat.v1.signal.rfft3d
lack input validation and under certain condition can result in crashes (due to CHECK
-failures). Versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4 contain a patch for this issue.
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): N/A
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
- TensorFlow installed from (source or binary): binary
- TensorFlow version (use command below): 2.8.0
- Python version:3.7.12
- Bazel version (if compiling from source):
- GCC/Compiler version (if compiling from source):
- CUDA/cuDNN version: 11.2 (based on a colab notebook)
- GPU model and memory: Tesla T4, 15109MiB (based on a colab notebook)
Describe the current behavior
The following code snippets lead to crashes when executed:
import numpy as np
import tensorflow as tf
a = np.empty([6, 0])
b = np.array([1, -1])
try:
tf.compat.v1.signal.rfft2d(input_tensor=a,fft_length=b)
# on a different machine: Check failed: size >= 0 (-9223372036854775808 vs. 0)
# Aborted (core dumped)
except:
pass
print('execution does not reach this line')
and
import numpy as np
import tensorflow as tf
a = np.empty([6, 1, 1])
b = np.array([1, 2, 0])
try:
tf.compat.v1.signal.irfft3d(input_tensor=a,fft_length=b)
# on a different machine: failed to initialize batched cufft plan with customized allocator: Failed to make cuFFT batched plan.
# Aborted (core dumped)
except:
pass
print('execution does not reach this line')
In either case, the inputs do not quite make sense, and tensorflow should throw.
Describe the expected behavior
Tensorflow should throw exceptions instead of crashing.
Contributing
- Do you want to contribute a PR? (yes/no):
- Briefly describe your candidate solution(if contributing):
Standalone code to reproduce the issue
Here is a colab notebook:
https://colab.research.google.com/drive/168jYG6MqnW4jpJdIXFMUBkyiaweA43aP?usp=sharing
Edit: the notebook has to be run with GPU
The code snippets above should also reproduce the issue.
Related news
The Western Digital My Cloud Web App [https://os5.mycloud.com/] uses a weak SSLContext when attempting to configure port forwarding rules. This was enabled to maintain compatibility with old or outdated home routers. By using an "SSL" context instead of "TLS" or specifying stronger validation, deprecated or insecure protocols are permitted. As a result, a local user with no privileges can exploit this vulnerability and jeopardize the integrity, confidentiality and authenticity of information transmitted. The scope of impact cannot extend to other components and no user input is required to exploit this vulnerability.
Implemented protections on AWS credentials that were not properly protected.
### Impact The `tf.compat.v1.signal.rfft2d` and `tf.compat.v1.signal.rfft3d` lack input validation and under certain condition can result in crashes (due to `CHECK`-failures). ### Patches We have patched the issue in GitHub commit [0a8a781e597b18ead006d19b7d23d0a369e9ad73](https://github.com/tensorflow/tensorflow/commit/0a8a781e597b18ead006d19b7d23d0a369e9ad73) (merging GitHub PR [#55274](https://github.com/tensorflow/tensorflow/pull/55274)). The fix will be included in TensorFlow 2.9.0. We will also cherrypick this commit on TensorFlow 2.8.1, TensorFlow 2.7.2, and TensorFlow 2.6.4, as these are also affected and still in supported range. ### For more information Please consult [our security guide](https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) 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 [GitHub issue](https://github.com/tensorflow/tensorf...
TensorFlow is an open source platform for machine learning. Prior to versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4, multiple TensorFlow operations misbehave in eager mode when the resource handle provided to them is invalid. In graph mode, it would have been impossible to perform these API calls, but migration to TF 2.x eager mode opened up this vulnerability. If the resource handle is empty, then a reference is bound to a null pointer inside TensorFlow codebase (various codepaths). This is undefined behavior. Versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4 contain a patch for this issue.