Segfault due to missing support for quantized types in TensorFlow
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, there is a potential for segfault / denial of service in TensorFlow by calling tf.compat.v1.* ops which don't yet have support for quantized types, which was added after migration to TensorFlow 2.x. In these scenarios, since the kernel is missing, a nullptr value is passed to ParseDimensionValue for the py_value argument. Then, this is dereferenced, resulting in segfault. 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
1237822b59fc5Fix tf.compat.v1.placeholder_with_default vulnerability with quantized types.
3 files changed · +6 −2
tensorflow/core/kernels/strided_slice_op.cc+1 −0 modified@@ -431,6 +431,7 @@ class StridedSliceAssignOp : public OpKernel { StridedSliceAssignOp<CPUDevice, type, true>) TF_CALL_ALL_TYPES(REGISTER_STRIDED_SLICE); +TF_CALL_QUANTIZED_TYPES(REGISTER_STRIDED_SLICE); #undef REGISTER_STRIDED_SLICE
tensorflow/core/kernels/strided_slice_op_impl.h+1 −1 modified@@ -292,7 +292,7 @@ TF_CALL_GPU_ALL_TYPES(DECLARE_FOR_N_GPU); #endif // END GOOGLE_CUDA || TENSORFLOW_USE_ROCM TF_CALL_ALL_TYPES(DECLARE_FOR_N_CPU); - +TF_CALL_QUANTIZED_TYPES(DECLARE_FOR_N_CPU); #undef INSTANTIATE #undef DECLARE_FOR_N_CPU
tensorflow/python/eager/pywrap_tfe_src.cc+4 −1 modified@@ -688,9 +688,12 @@ bool SetOpAttrScalar(TFE_Context* ctx, TFE_Op* op, const char* key, for (int i = 0; i < num_dims; ++i) { tensorflow::Safe_PyObjectPtr inner_py_value( PySequence_ITEM(py_value, i)); + // If an error is generated when iterating through object, we can + // sometimes get a nullptr. if (inner_py_value.get() == Py_None) { dims[i] = -1; - } else if (!ParseDimensionValue(key, inner_py_value.get(), status, + } else if (inner_py_value.get() == nullptr || + !ParseDimensionValue(key, inner_py_value.get(), status, &dims[i])) { return false; }
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
10- github.com/advisories/GHSA-54ch-gjq5-4976ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-29205ghsaADVISORY
- github.com/tensorflow/tensorflow/blob/f3b9bf4c3c0597563b289c0512e98d4ce81f886e/tensorflow/python/eager/pywrap_tfe_src.ccghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/blob/f3b9bf4c3c0597563b289c0512e98d4ce81f886e/tensorflow/python/eager/pywrap_tfe_src.ccghsax_refsource_MISCWEB
- github.com/tensorflow/tensorflow/commit/237822b59fc504dda2c564787f5d3ad9c4aa62d9ghsax_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-54ch-gjq5-4976ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.