An open API service providing security vulnerability metadata for many open source software ecosystems.

GSA_kwCzR0hTQS1yd3c3LTJncHctZnY2as0osg

High CVSS: 7.1 EPSS: 0.00507% (0.65577 Percentile) EPSS:

Crash when type cannot be specialized in Tensorflow

Affected Packages Affected Versions Fixed Versions
pypi:tensorflow-gpu
PURL: pkg:pypi/tensorflow-gpu
= 2.7.0, >= 2.6.0, < 2.6.3, < 2.5.3 2.7.1, 2.6.3, 2.5.3
155 Dependent packages
11,499 Dependent repositories
105,992 Downloads last month

Affected Version Ranges

All affected versions

0.12.0, 0.12.1, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.9.0, 1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.12.2, 1.12.3, 1.13.1, 1.13.2, 1.14.0, 1.15.0, 1.15.2, 1.15.3, 1.15.4, 1.15.5, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.0rc0, 2.7.0rc1

All unaffected versions

2.5.3, 2.6.3, 2.6.4, 2.6.5, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0, 2.8.0rc0, 2.8.0rc1, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.1, 2.9.2, 2.9.3, 2.10.0, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.1, 2.11.0, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.12.0

pypi:tensorflow-cpu
PURL: pkg:pypi/tensorflow-cpu
= 2.7.0, >= 2.6.0, < 2.6.3, < 2.5.3 2.7.1, 2.6.3, 2.5.3
88 Dependent packages
2,483 Dependent repositories
1,060,425 Downloads last month

Affected Version Ranges

All affected versions

1.15.0, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.6.0, 2.6.1, 2.6.2, 2.7.0, 2.7.0rc0, 2.7.0rc1

All unaffected versions

2.5.3, 2.6.3, 2.6.4, 2.6.5, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0, 2.8.0rc0, 2.8.0rc1, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.1, 2.9.2, 2.9.3, 2.10.0, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.1, 2.11.0, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.11.1, 2.12.0, 2.12.0rc0, 2.12.0rc1, 2.12.1, 2.13.0, 2.13.0rc0, 2.13.0rc1, 2.13.0rc2, 2.13.1, 2.14.0, 2.14.0rc0, 2.14.0rc1, 2.14.1, 2.15.0, 2.15.0rc0, 2.15.0rc1, 2.15.1, 2.16.0rc0, 2.16.1, 2.16.2, 2.17.0, 2.17.0rc0, 2.17.0rc1, 2.17.1, 2.18.0, 2.18.0rc0, 2.18.0rc1, 2.18.0rc2, 2.18.1, 2.19.0, 2.19.0rc0, 2.19.1, 2.20.0, 2.20.0rc0

pypi:tensorflow
PURL: pkg:pypi/tensorflow
= 2.7.0, >= 2.6.0, < 2.6.3, < 2.5.3 2.7.1, 2.6.3, 2.5.3
2,172 Dependent packages
73,755 Dependent repositories
21,825,433 Downloads last month

Affected Version Ranges

All affected versions

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.14.0rc1, 2.14.1, 2.15.0, 2.15.0rc0, 2.15.0rc1, 2.15.1, 2.16.0rc0, 2.16.1, 2.16.2, 2.17.0, 2.17.0rc0, 2.17.0rc1, 2.17.1, 2.18.0, 2.18.0rc0, 2.18.0rc1, 2.18.0rc2, 2.18.1, 2.19.0, 2.19.0rc0, 2.19.1, 2.20.0rc0

Impact

Under certain scenarios, TensorFlow can fail to specialize a type during shape inference:

void InferenceContext::PreInputInit(
    const OpDef& op_def, const std::vector<const Tensor*>& input_tensors,
    const std::vector<ShapeHandle>& input_tensors_as_shapes) {
  const auto ret = full_type::SpecializeType(attrs_, op_def);
  DCHECK(ret.status().ok()) << "while instantiating types: " << ret.status();
  ret_types_ = ret.ValueOrDie();
  // ... 
}

However, DCHECK is a no-op in production builds and an assertion failure in debug builds. In the first case execution proceeds to the ValueOrDie line. This results in an assertion failure as ret contains an error Status, not a value. In the second case we also get a crash due to the assertion failure.

Patches

We have patched the issue in GitHub commit cb164786dc891ea11d3a900e90367c339305dc7b.

The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, and TensorFlow 2.6.3, as these are also affected and still in supported range.

For more information

Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.

References: