VYPR
High severityNVD Advisory· Published Aug 12, 2021· Updated Aug 4, 2024

Reference binding to nullptr in unicode encoding in TensorFlow

CVE-2021-37667

Description

TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can cause undefined behavior via binding a reference to null pointer in tf.raw_ops.UnicodeEncode. The implementation reads the first dimension of the input_splits tensor before validating that this tensor is not empty. We have patched the issue in GitHub commit 2e0ee46f1a47675152d3d865797a18358881d7a6. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
tensorflowPyPI
< 2.3.42.3.4
tensorflowPyPI
>= 2.4.0, < 2.4.32.4.3
tensorflowPyPI
>= 2.5.0, < 2.5.12.5.1
tensorflow-cpuPyPI
< 2.3.42.3.4
tensorflow-cpuPyPI
>= 2.4.0, < 2.4.32.4.3
tensorflow-cpuPyPI
>= 2.5.0, < 2.5.12.5.1
tensorflow-gpuPyPI
< 2.3.42.3.4
tensorflow-gpuPyPI
>= 2.4.0, < 2.4.32.4.3
tensorflow-gpuPyPI
>= 2.5.0, < 2.5.12.5.1

Affected products

1

Patches

1
2e0ee46f1a47

Ensure non-empty input_splits in tf.raw_ops.UnicodeEncode

https://github.com/tensorflow/tensorflowLaura PakJul 27, 2021via ghsa
1 file changed · +4 0
  • tensorflow/core/kernels/unicode_ops.cc+4 0 modified
    @@ -533,6 +533,10 @@ class UnicodeEncodeOp : public OpKernel {
         const Tensor& input_splits = context->input(1);
         const auto input_splits_flat = input_splits.flat<SPLITS_TYPE>();
     
    +    OP_REQUIRES(
    +        context, input_splits.NumElements() > 0,
    +        errors::InvalidArgument("Input_splits should contain elements, but "
    +                                "given input_values has 0 elements"));
         // Operation will treat first argument in input_splits as if it were zero
         // regardless of its actual value since splits should begin with zero and
         // end with the length of the input values vector.
    

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

7

News mentions

0

No linked articles in our index yet.