Moderate severityNVD Advisory· Published Nov 18, 2022· Updated Apr 22, 2025
Out of bounds segmentation fault due to unequal op inputs in Tensorflow
CVE-2022-41883
Description
TensorFlow is an open source platform for machine learning. When ops that have specified input sizes receive a differing number of inputs, the executor will crash. We have patched the issue in GitHub commit f5381e0e10b5a61344109c1b7c174c68110f7629. 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.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
tensorflowPyPI | >= 2.10.0, < 2.10.1 | 2.10.1 |
tensorflow-cpuPyPI | >= 2.10.0, < 2.10.1 | 2.10.1 |
tensorflow-gpuPyPI | >= 2.10.0, < 2.10.1 | 2.10.1 |
Affected products
1- Range: >= 2.10.0, < 2.10.1
Patches
1f5381e0e10b5Fix OOB error when op input sizes do not match.
2 files changed · +28 −0
tensorflow/core/common_runtime/eager/execute.cc+4 −0 modified@@ -313,6 +313,10 @@ bool IsHostMemoryArg(const EagerOperation& op, const NodeDef* node_def, const auto& host_memory_args = kernel_def->host_memory_arg(); const OpDef& op_def = OpRegistry::Global()->LookUp(op.Name())->op_def; const int arg_id = OpPortIdToArgId(*node_def, op_def.input_arg(), port_id); + // Fail if argument ID not found. + if (arg_id < 0) { + return false; + } return std::find(host_memory_args.begin(), host_memory_args.end(), op_def.input_arg(arg_id).name()) != host_memory_args.end(); }
tensorflow/python/kernel_tests/data_structures/dynamic_stitch_op_test.py+24 −0 modified@@ -18,6 +18,7 @@ from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes +from tensorflow.python.framework import errors from tensorflow.python.framework import test_util from tensorflow.python.ops import array_ops from tensorflow.python.ops import data_flow_ops @@ -308,6 +309,29 @@ def testHigherRankGPU(self): for datum, grad in zip(data, self.evaluate(grads[3:])): self.assertAllEqual(7.0 * self.evaluate(datum), grad) + @test_util.run_in_graph_and_eager_modes + def testMismatchedDataAndIndexListSizes(self): + indices = [ + constant_op.constant([2]), + constant_op.constant([1]), + constant_op.constant([0]), + constant_op.constant([3]), + ] + data = [ + constant_op.constant([1.0]), + constant_op.constant([2.0]), + constant_op.constant([3.0]), + constant_op.constant([4.0]) + ] + with self.assertRaisesRegex( + (ValueError, errors.InvalidArgumentError), + "expected inputs .* do not match|List argument .* must match"): + self.evaluate(data_flow_ops.dynamic_stitch(indices[0:2], data)) + + with self.assertRaisesRegex( + (ValueError, errors.InvalidArgumentError), + "expected inputs .* do not match|List argument .* must match"): + self.evaluate(data_flow_ops.dynamic_stitch(indices, data[0:2])) if __name__ == "__main__": test.main()
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/advisories/GHSA-w58w-79xv-6vcjghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-41883ghsaADVISORY
- github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/dynamic_stitch_op.ccghsaWEB
- github.com/tensorflow/tensorflow/blob/master/tensorflow/core/ops/data_flow_ops.ccghsaWEB
- github.com/tensorflow/tensorflow/commit/f5381e0e10b5a61344109c1b7c174c68110f7629ghsaWEB
- github.com/tensorflow/tensorflow/security/advisories/GHSA-w58w-79xv-6vcjghsaWEB
News mentions
0No linked articles in our index yet.