VYPR
High severityNVD Advisory· Published Feb 4, 2022· Updated Apr 22, 2025

Uninitialized variable access in Tensorflow

CVE-2022-23573

Description

Tensorflow is an Open Source Machine Learning Framework. The implementation of AssignOp can result in copying uninitialized data to a new tensor. This later results in undefined behavior. The implementation has a check that the left hand side of the assignment is initialized (to minimize number of allocations), but does not check that the right hand side is also initialized. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
tensorflowPyPI
< 2.5.32.5.3
tensorflowPyPI
>= 2.6.0, < 2.6.32.6.3
tensorflowPyPI
>= 2.7.0, < 2.7.12.7.1
tensorflow-cpuPyPI
< 2.5.32.5.3
tensorflow-cpuPyPI
>= 2.6.0, < 2.6.32.6.3
tensorflow-cpuPyPI
>= 2.7.0, < 2.7.12.7.1
tensorflow-gpuPyPI
< 2.5.32.5.3
tensorflow-gpuPyPI
>= 2.6.0, < 2.6.32.6.3
tensorflow-gpuPyPI
>= 2.7.0, < 2.7.12.7.1

Affected products

1

Patches

1
ef1d027be116

Prevent copying uninitialized data in `AssignOp`.

https://github.com/tensorflow/tensorflowMihai MaruseacNov 9, 2021via ghsa
1 file changed · +6 0
  • tensorflow/core/kernels/assign_op.h+6 0 modified
    @@ -50,6 +50,12 @@ class AssignOp : public OpKernel {
         // We always return the input ref.
         context->forward_ref_input_to_ref_output(0, 0);
     
    +    // Prevent copying uninitialized data, to solve harder to debug undefined
    +    // behaviors that cannot be traced back to the original tensor.
    +    OP_REQUIRES(
    +        context, rhs.IsInitialized(),
    +        errors::Internal("Right hand side of AssignOp is not initialized"));
    +
         // We can't always know how this value will be used downstream, so make
         // conservative assumptions in specifying constraints on the memory
         // allocation attributes, unless the Grappler graph analysis determined that
    

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.