GHSA-gwcx-jrx4-92w2

Suggest an improvement
Source
https://github.com/advisories/GHSA-gwcx-jrx4-92w2
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/02/GHSA-gwcx-jrx4-92w2/GHSA-gwcx-jrx4-92w2.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-gwcx-jrx4-92w2
Aliases
Related
Published
2022-02-09T23:32:08Z
Modified
2024-11-13T22:25:18.516915Z
Severity
  • 5.9 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
  • 8.2 (High) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N CVSS Calculator
Summary
Segfault in `simplifyBroadcast` in Tensorflow
Details

Impact

The simplifyBroadcast function in the MLIR-TFRT infrastructure in TensorFlow is vulnerable to a segfault (hence, denial of service), if called with scalar shapes.

  size_t maxRank = 0;
  for (auto shape : llvm::enumerate(shapes)) {
    auto found_shape = analysis.dimensionsForShapeTensor(shape.value());
    if (!found_shape) return {};
    shapes_found.push_back(*found_shape);
    maxRank = std::max(maxRank, found_shape->size());
  }   

  SmallVector<const ShapeComponentAnalysis::SymbolicDimension*>
      joined_dimensions(maxRank);

If all shapes are scalar, then maxRank is 0, so we build an empty SmallVector.

Patches

We have patched the issue in GitHub commit 35f0fabb4c178253a964d7aabdbb15c6a398b69a.

The fix will be included in TensorFlow 2.8.0. This is the only affected version.

For more information

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

Database specific
{
    "nvd_published_at": "2022-02-04T23:15:00Z",
    "cwe_ids": [
        "CWE-754"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2022-02-04T18:15:07Z"
}
References

Affected packages

PyPI / tensorflow

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.8.0-rc0
Fixed
2.8.0

Affected versions

2.*

2.8.0-rc0
2.8.0rc0
2.8.0rc1

PyPI / tensorflow-cpu

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.8.0-rc0
Fixed
2.8.0

Affected versions

2.*

2.8.0-rc0

PyPI / tensorflow-gpu

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.8.0-rc0
Fixed
2.8.0

Affected versions

2.*

2.8.0-rc0
2.8.0rc0
2.8.0rc1