CVE-2023-25670: TensorFlow CPU Null Pointer Error in QuantizedMatMulWithBiasAndDequantize
Summary
CVE-2023-25670: TensorFlow has Null Pointer Error in QuantizedMatMulWithBiasAndDequantize. Affects tensorflow-cpu versions < 2.11.1. Fixed in 2.11.1. How to fix ↓
Also tracked for
- tensorflow · PyPI
- tensorflow-gpu · PyPI
- tensorflow · Bitnami
- tensorflow · PyPI
The same CVE-2023-25670 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
TensorFlow is an open-source machine learning framework widely used for building and training deep learning models. It provides a comprehensive ecosystem for developing applications that require complex mathematical computations. The TensorFlow CPU package is specifically designed for environments where GPU acceleration is not available. This package includes various operations, including quantized matrix multiplication, which optimizes performance for low-precision data types. However, a recent vulnerability has been identified in the QuantizedMatMulWithBiasAndDequantize operation, which can lead to a null pointer error under certain conditions.
Vulnerability Detail
The vulnerability arises from a null pointer error (NPE) in the QuantizedMatMulWithBiasAndDequantize function when using the MKL (Math Kernel Library) feature. This can occur when specific parameters are passed to the function, leading to potential crashes or unexpected behavior in applications utilizing this operation. The issue is particularly concerning as it may affect the stability and reliability of machine learning models that rely on this functionality, potentially causing data loss or corruption during processing.
How To Fix
Latest published version: 2.21.0 as of 22 Oct 2026
pip install --upgrade "tensorflow-cpu==2.21.0"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
2.11.1
This is the first release that contains the fix.
pip install --upgrade "tensorflow-cpu==2.11.1"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can avoid using the QuantizedMatMulWithBiasAndDequantize function with the specific parameters that trigger the null pointer error. Here is an example of how to modify the parameters to prevent the error:
import tensorflow as tf
func = tf.raw_ops.QuantizedMatMulWithBiasAndDequantize
para = {
'a': tf.constant(138, dtype=tf.quint8),
'b': tf.constant(4, dtype=tf.qint8),
'bias': [[31.81644630432129, 47.21876525878906], [109.95201110839844, 152.07968139648438]],
'min_a': 141.5337138686371,
'max_a': [73.84139251708984, 173.15280151367188],
'min_b': [],
'max_b': [[16.128345489501953, 193.26820373535156]],
'min_freezed_output': [],
'max_freezed_output': [115.50032806396484, 156.974853515625],
'Toutput': 1.0,
'transpose_a': True,
'transpose_b': False,
'input_quant_mode': 'MIN_FIRST'
}
# Modify parameters to avoid NPE
# Ensure min_b and min_freezed_output are set appropriately
func(**para)
Conclusion
The identified vulnerability in TensorFlow CPU's QuantizedMatMulWithBiasAndDequantize function poses a risk of null pointer errors, which can affect application stability. It is crucial to update to the patched version 2.11.1 or later to mitigate this risk. Additionally, users can implement workarounds to avoid triggering the error until they can update.
See every vulnerability recorded for tensorflow-cpu →
FAQ
The CVSS score of this vulnerability is 7.5, indicating a high severity level.
The vulnerability affects TensorFlow CPU versions prior to 2.11.1.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
This vulnerability was reported by a user identified as r3pwnx.
Yes, TensorFlow has a security guide available at https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md for more information on their security model.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow-cpu.