VYPR
Moderate severityNVD Advisory· Published May 20, 2022· Updated Apr 22, 2025

Segfault due to missing support for quantized types in TensorFlow

CVE-2022-29205

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.

PackageAffected versionsPatched versions
tensorflowPyPI
< 2.6.42.6.4
tensorflowPyPI
>= 2.7.0, < 2.7.22.7.2
tensorflowPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflow-cpuPyPI
< 2.6.42.6.4
tensorflow-cpuPyPI
>= 2.7.0, < 2.7.22.7.2
tensorflow-cpuPyPI
>= 2.8.0, < 2.8.12.8.1
tensorflow-gpuPyPI
< 2.6.42.6.4
tensorflow-gpuPyPI
>= 2.7.0, < 2.7.22.7.2
tensorflow-gpuPyPI
>= 2.8.0, < 2.8.12.8.1

Affected products

1

Patches

1
237822b59fc5

Fix tf.compat.v1.placeholder_with_default vulnerability with quantized types.

https://github.com/tensorflow/tensorflowAntonio SanchezApr 28, 2022via ghsa
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

News mentions

0

No linked articles in our index yet.