Missing validation causes denial of service in TensorFlow via `LoadAndRemapMatrix`
Description
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 implementation of tf.raw_ops.LoadAndRemapMatrix does not fully validate the input arguments. This results in a CHECK-failure which can be used to trigger a denial of service attack. The code assumes initializing_values` is a vector but there is no validation for this before accessing its value. Versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4 contain a patch for this issue.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
tensorflowPyPI | < 2.6.4 | 2.6.4 |
tensorflowPyPI | >= 2.7.0, < 2.7.2 | 2.7.2 |
tensorflowPyPI | >= 2.8.0, < 2.8.1 | 2.8.1 |
tensorflow-cpuPyPI | < 2.6.4 | 2.6.4 |
tensorflow-cpuPyPI | >= 2.7.0, < 2.7.2 | 2.7.2 |
tensorflow-cpuPyPI | >= 2.8.0, < 2.8.1 | 2.8.1 |
tensorflow-gpuPyPI | < 2.6.4 | 2.6.4 |
tensorflow-gpuPyPI | >= 2.7.0, < 2.7.2 | 2.7.2 |
tensorflow-gpuPyPI | >= 2.8.0, < 2.8.1 | 2.8.1 |
Affected products
1- Range: < 2.6.4
Patches
13150642acbbeFix tf.raw_ops.LoadAndRemapMatrix vulnerability with invalid `row_remapping`.
2 files changed · +31 −0
tensorflow/core/kernels/load_and_remap_matrix_op.cc+5 −0 modified@@ -74,6 +74,11 @@ class LoadAndRemapMatrixOp : public OpKernel { std::vector<bool> row_id_present; const Tensor* row_remapping_t; OP_REQUIRES_OK(context, context->input("row_remapping", &row_remapping_t)); + OP_REQUIRES( + context, row_remapping_t->dims() == 1, + errors::InvalidArgument("The `row_remapping` tensor must be 1-D, got " + "a tensor of shape ", + row_remapping_t->shape().DebugString())); const auto row_remapping = row_remapping_t->vec<int64_t>(); OP_REQUIRES(context, row_remapping.size() == num_rows_, errors::InvalidArgument(strings::StrCat(
tensorflow/python/kernel_tests/io_ops/checkpoint_ops_test.py+26 −0 modified@@ -227,6 +227,32 @@ def test_load_and_remap_all_missing_rows_and_cols(self): np.reshape(initializing_values, (num_rows, num_cols)), self.evaluate(remapped_matrix)) + def test_load_and_remap_invalid_dims(self): + ckpt_path = constant_op.constant( + '/tmp/warm_starting_util_test5kl2a3pc/tmpph76tep2/model-0', + shape=[], + dtype=dtypes.string) + old_tensor_name = constant_op.constant( + '/tmp/warm_starting_util_test5kl2a3pc/tmpph76tep2/model-0', + shape=[], + dtype=dtypes.string) + row_remapping = constant_op.constant(0, shape=[], dtype=dtypes.int64) + col_remapping = constant_op.constant(3, shape=[3], dtype=dtypes.int64) + initializing_values = constant_op.constant([], + shape=[0, 1], + dtype=dtypes.float32) + with self.cached_session(), self.assertRaisesRegex( + (ValueError, errors.InvalidArgumentError), 'tensor must be 1-D'): + self.evaluate( + gen_checkpoint_ops.load_and_remap_matrix( + ckpt_path=ckpt_path, + old_tensor_name=old_tensor_name, + row_remapping=row_remapping, + col_remapping=col_remapping, + initializing_values=initializing_values, + num_rows=1, + num_cols=1)) + @test_util.run_deprecated_v1 def test_load_and_remap_invalid_remapping(self): """Tests that errors are raised when an ID maps to multiple new IDs.
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
9- github.com/advisories/GHSA-p9rc-rmr5-529jghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-29199ghsaADVISORY
- github.com/tensorflow/tensorflow/blob/f3b9bf4c3c0597563b289c0512e98d4ce81f886e/tensorflow/core/kernels/load_and_remap_matrix_op.ccghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/commit/3150642acbbe254e3c3c5d2232143fa591855ac9ghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/releases/tag/v2.6.4ghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/releases/tag/v2.7.2ghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/releases/tag/v2.8.1ghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/releases/tag/v2.9.0ghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/security/advisories/GHSA-p9rc-rmr5-529jghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.