TensorFlow CONV_3D_TRANSPOSE Buffer Overflow (pre-2.11)
CVE-2022-41894 Published on November 18, 2022
Buffer overflow in `CONV_3D_TRANSPOSE` on TFLite
TensorFlow is an open source platform for machine learning. The reference kernel of the `CONV_3D_TRANSPOSE` TensorFlow Lite operator wrongly increments the data_ptr when adding the bias to the result. Instead of `data_ptr += num_channels;` it should be `data_ptr += output_num_channels;` as if the number of input channels is different than the number of output channels, the wrong result will be returned and a buffer overflow will occur if num_channels > output_num_channels. An attacker can craft a model with a specific number of input channels. It is then possible to write specific values through the bias of the layer outside the bounds of the buffer. This attack only works if the reference kernel resolver is used in the interpreter. We have patched the issue in GitHub commit 72c0bdcb25305b0b36842d746cc61d72658d2941. The fix will be included in TensorFlow 2.11. We will also cherrypick this commit on TensorFlow 2.10.1, 2.9.3, and TensorFlow 2.8.4, as these are also affected and still in supported range.
Vulnerability Analysis
CVE-2022-41894 is exploitable with network access, requires user interaction and a small amount of user privileges. This vulnerability is consided to have a high level of attack complexity. Public availability of a proof of concept (POC) exploit exists for CVE-2022-41894. The potential impact of an exploit of this vulnerability is considered to be very high.
Weakness Type
What is a Classic Buffer Overflow Vulnerability?
The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow. A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the "classic" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.
CVE-2022-41894 has been classified to as a Classic Buffer Overflow vulnerability or weakness.
Products Associated with CVE-2022-41894
Want to know whenever a new CVE is published for Google Tensorflow? stack.watch will email you.
Affected Versions
tensorflow:- Version >= 2.10.0, < 2.10.1 is affected.
- Version >= 2.9.0, < 2.9.3 is affected.
- Version < 2.8.4 is affected.
Vulnerable Packages
The following package name and versions may be associated with CVE-2022-41894
| Package Manager | Vulnerable Package | Versions | Fixed In |
|---|---|---|---|
| pip | tflite | < 2.8.4 | 2.8.4 |
| pip | tflite | >= 2.9.0, < 2.9.3 | 2.9.3 |
| pip | tflite | >= 2.10.0, < 2.10.1 | 2.10.1 |
Exploit Probability
EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.