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

Heap OOB in boosted trees in TensorFlow

CVE-2021-37664

Description

TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can read from outside of bounds of heap allocated data by sending specially crafted illegal arguments to BoostedTreesSparseCalculateBestFeatureSplit. The implementation needs to validate that each value in stats_summary_indices is in range. We have patched the issue in GitHub commit e84c975313e8e8e38bb2ea118196369c45c51378. 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
e84c975313e8

In tf.raw_ops.BoostedTreesSparseCalculateBestFeatureSplit, limit stat_dim in stats_summary_indices to under stats_dims in stats_summary_shape

https://github.com/tensorflow/tensorflowLaura PakJul 27, 2021via ghsa
1 file changed · +7 0
  • tensorflow/core/kernels/boosted_trees/stats_ops.cc+7 0 modified
    @@ -1050,6 +1050,13 @@ class BoostedTreesSparseCalculateBestFeatureSplitOp : public OpKernel {
           const int32_t feature_dim = stats_summary_indices(idx, 1);
           const int32_t bucket_id = stats_summary_indices(idx, 2);
           const int32_t stat_dim = stats_summary_indices(idx, 3);
    +      OP_REQUIRES(context, stat_dim < stats_dims,
    +                  errors::InvalidArgument(
    +                      "Stat dim, the sum of logits dim and hessian dim in "
    +                      "stats_summary_indices, cannot be greater than stats "
    +                      "dims, the last value in stats_summary_shape, which was ",
    +                      stats_dims, ". At index (", idx,
    +                      ", 4), stats_summary_indices contains value ", stat_dim));
           std::pair<FeatureMapIterator, bool> const& f_insert_result = f_map.insert(
               FeatureMapIterator::value_type(feature_dim, BucketMap()));
           auto& b_map = f_insert_result.first->second;
    

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.