VYPR
Moderate severityNVD Advisory· Published Sep 25, 2020· Updated Aug 4, 2024

Segfault and data corruption in tensorflow-lite

CVE-2020-15207

Description

In tensorflow-lite before versions 1.15.4, 2.0.3, 2.1.2, 2.2.1 and 2.3.1, to mimic Python's indexing with negative values, TFLite uses ResolveAxis to convert negative values to positive indices. However, the only check that the converted index is now valid is only present in debug builds. If the DCHECK does not trigger, then code execution moves ahead with a negative index. This, in turn, results in accessing data out of bounds which results in segfaults and/or data corruption. The issue is patched in commit 2d88f470dea2671b430884260f3626b1fe99830a, and is released in TensorFlow versions 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
tensorflowPyPI
< 1.15.41.15.4
tensorflowPyPI
>= 2.0.0, < 2.0.32.0.3
tensorflowPyPI
>= 2.1.0, < 2.1.22.1.2
tensorflowPyPI
>= 2.2.0, < 2.2.12.2.1
tensorflowPyPI
>= 2.3.0, < 2.3.12.3.1
tensorflow-cpuPyPI
< 1.15.41.15.4
tensorflow-cpuPyPI
>= 2.0.0, < 2.0.32.0.3
tensorflow-cpuPyPI
>= 2.1.0, < 2.1.22.1.2
tensorflow-cpuPyPI
>= 2.2.0, < 2.2.12.2.1
tensorflow-cpuPyPI
>= 2.3.0, < 2.3.12.3.1
tensorflow-gpuPyPI
< 1.15.41.15.4
tensorflow-gpuPyPI
>= 2.0.0, < 2.0.32.0.3
tensorflow-gpuPyPI
>= 2.1.0, < 2.1.22.1.2
tensorflow-gpuPyPI
>= 2.2.0, < 2.2.12.2.1
tensorflow-gpuPyPI
>= 2.3.0, < 2.3.12.3.1

Affected products

1

Patches

1
2d88f470dea2

[tflite] Ensure `ResolveAxis` properly handles negative inputs.

https://github.com/tensorflow/tensorflowMihai MaruseacSep 18, 2020via ghsa
1 file changed · +3 0
  • tensorflow/lite/kernels/internal/reference/reduce.h+3 0 modified
    @@ -70,6 +70,9 @@ inline bool ResolveAxis(const int num_dims, const int* axis,
         // eg: For num_dims=3, [0, 1, 2] is the same as [-3, -2, -1]  */
         int current = axis[idx] < 0 ? (axis[idx] + num_dims) : axis[idx];
         TFLITE_DCHECK(current >= 0 && current < num_dims);
    +    if (current < 0 || current >= num_dims) {
    +      return false;
    +    }
         bool is_dup = false;
         for (int j = 0; j < *out_num_axis; ++j) {
           if (out_axis[j] == current) {
    

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

News mentions

0

No linked articles in our index yet.