Loading HuntDB...

CVE-2022-29208

HIGH
Published 2022-05-20T22:30:13.000Z
Actions:

Expert Analysis

Professional remediation guidance

Get tailored security recommendations from our analyst team for CVE-2022-29208. We'll provide specific mitigation strategies based on your environment and risk profile.

CVSS Score

V3.1
7.1
/10
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H
Base Score Metrics
Exploitability: N/A Impact: N/A

EPSS Score

v2025.03.14
0.001
probability
of exploitation in the wild

There is a 0.1% chance that this vulnerability will be exploited in the wild within the next 30 days.

Updated: 2025-06-25
Exploit Probability
Percentile: 0.302
Higher than 30.2% of all CVEs

Attack Vector Metrics

Attack Vector
LOCAL
Attack Complexity
LOW
Privileges Required
LOW
User Interaction
NONE
Scope
UNCHANGED

Impact Metrics

Confidentiality
NONE
Integrity
HIGH
Availability
HIGH

Description

TensorFlow is an open source platform for machine learning. Prior to versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4, the implementation of `tf.raw_ops.EditDistance` has incomplete validation. Users can pass negative values to cause a segmentation fault based denial of service. In multiple places throughout the code, one may compute an index for a write operation. However, the existing validation only checks against the upper bound of the array. Hence, it is possible to write before the array by massaging the input to generate negative values for `loc`. Versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4 contain a patch for this issue.

Available Exploits

No exploits available for this CVE.

Related News

No news articles found for this CVE.

Affected Products

GitHub Security Advisories

Community-driven vulnerability intelligence from GitHub

✓ GitHub Reviewed HIGH

Segfault and OOB write due to incomplete validation in `EditDistance` in TensorFlow

GHSA-2r2f-g8mw-9gvr

Advisory Details

### Impact The implementation of [`tf.raw_ops.EditDistance`]() has incomplete validation. Users can pass negative values to cause a segmentation fault based denial of service: ```python import tensorflow as tf hypothesis_indices = tf.constant(-1250999896764, shape=[3, 3], dtype=tf.int64) hypothesis_values = tf.constant(0, shape=[3], dtype=tf.int64) hypothesis_shape = tf.constant(0, shape=[3], dtype=tf.int64) truth_indices = tf.constant(-1250999896764, shape=[3, 3], dtype=tf.int64) truth_values = tf.constant(2, shape=[3], dtype=tf.int64) truth_shape = tf.constant(2, shape=[3], dtype=tf.int64) tf.raw_ops.EditDistance( hypothesis_indices=hypothesis_indices, hypothesis_values=hypothesis_values, hypothesis_shape=hypothesis_shape, truth_indices=truth_indices, truth_values=truth_values, truth_shape=truth_shape) ``` In multiple places throughout the code, we are computing an index for a write operation: ```cc if (g_truth == g_hypothesis) { auto loc = std::inner_product(g_truth.begin(), g_truth.end(), output_strides.begin(), int64_t{0}); OP_REQUIRES( ctx, loc < output_elements, errors::Internal("Got an inner product ", loc, " which would require in writing to outside of " "the buffer for the output tensor (max elements ", output_elements, ")")); output_t(loc) = gtl::LevenshteinDistance<T>(truth_seq, hypothesis_seq, cmp); // ... } ``` However, the existing validation only checks against the upper bound of the array. Hence, it is possible to write before the array by massaging the input to generate negative values for `loc`. ### Patches We have patched the issue in GitHub commit [30721cf564cb029d34535446d6a5a6357bebc8e7](https://github.com/tensorflow/tensorflow/commit/30721cf564cb029d34535446d6a5a6357bebc8e7). The fix will be included in TensorFlow 2.9.0. We will also cherrypick this commit on TensorFlow 2.8.1, TensorFlow 2.7.2, and TensorFlow 2.6.4, as these are also affected and still in supported range. ### For more information Please consult [our security guide](https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) for more information regarding the security model and how to contact us with issues and questions. ### Attribution This vulnerability has been reported by Neophytos Christou from Secure Systems Lab at Brown University.

Affected Packages

PyPI tensorflow
ECOSYSTEM: ≥0 <2.6.4
PyPI tensorflow
ECOSYSTEM: ≥2.7.0 <2.7.2
PyPI tensorflow
ECOSYSTEM: ≥2.8.0 <2.8.1
PyPI tensorflow-cpu
ECOSYSTEM: ≥0 <2.6.4
PyPI tensorflow-cpu
ECOSYSTEM: ≥2.7.0 <2.7.2
PyPI tensorflow-cpu
ECOSYSTEM: ≥2.8.0 <2.8.1
PyPI tensorflow-gpu
ECOSYSTEM: ≥0 <2.6.4
PyPI tensorflow-gpu
ECOSYSTEM: ≥2.7.0 <2.7.2
PyPI tensorflow-gpu
ECOSYSTEM: ≥2.8.0 <2.8.1

CVSS Scoring

CVSS Score

7.5

CVSS Vector

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H

Advisory provided by GitHub Security Advisory Database. Published: May 24, 2022, Modified: June 6, 2022

References

Published: 2022-05-20T22:30:13.000Z
Last Modified: 2025-04-22T17:58:20.112Z
Copied to clipboard!