Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2022-35952: Fix security vulnerability with UnbatchGradKernel · tensorflow/tensorflow@5f945fc

TensorFlow is an open source platform for machine learning. The UnbatchGradOp function takes an argument id that is assumed to be a scalar. A nonscalar id can trigger a CHECK failure and crash the program. It also requires its argument batch_index to contain three times the number of elements as indicated in its batch_index.dim_size(0). An incorrect batch_index can trigger a CHECK failure and crash the program. We have patched the issue in GitHub commit 5f945fc6409a3c1e90d6970c9292f805f6e6ddf2. The fix will be included in TensorFlow 2.10.0. We will also cherrypick this commit on TensorFlow 2.9.1, TensorFlow 2.8.1, and TensorFlow 2.7.2, as these are also affected and still in supported range. There are no known workarounds for this issue.

CVE
#vulnerability#mac#git

@@ -20,7 +20,9 @@
from tensorflow.core.protobuf import config_pb2 from tensorflow.python.eager import context from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import errors from tensorflow.python.framework import function from tensorflow.python.framework import ops from tensorflow.python.framework import test_util @@ -30,6 +32,7 @@ from tensorflow.python.ops import gen_batch_ops from tensorflow.python.ops import gen_functional_ops from tensorflow.python.ops import math_ops from tensorflow.python.ops import random_ops from tensorflow.python.ops import resource_variable_ops from tensorflow.python.ops import script_ops from tensorflow.python.ops import variables @@ -557,6 +560,56 @@ def worker(): # The thread’s call should hit the timeout, and thus get 0 results. self.assertEqual(len(thread_results), 0)
def testUnbatchGradInvalidId(self): with self.assertRaises(errors.InvalidArgumentError): self.evaluate( gen_batch_ops.unbatch_grad( original_input=constant_op.constant([1]), batch_index=constant_op.constant([ [0, 0, 0], ], dtype=dtypes.int64), grad=constant_op.constant([ 1, ]), id=constant_op.constant([ 1, 1, ], dtype=dtypes.int64)))
def testUnbatchGradInvalidBatchId(self): with self.assertRaises(errors.InvalidArgumentError): self.evaluate( gen_batch_ops.unbatch_grad( original_input=constant_op.constant([1]), batch_index=constant_op.constant([ [0, 0], ], dtype=dtypes.int64), grad=constant_op.constant([ 1, ]), id=constant_op.constant([ 1, ], dtype=dtypes.int64)))
def testUnbatchGradInvalidArgs(self): original_input = random_ops.random_uniform( shape=(3, 1), dtype=dtypes.float64, maxval=None) batch_index = random_ops.random_uniform( shape=(3, 1), dtype=dtypes.int64, maxval=65536) grad = random_ops.random_uniform( shape=(3, 1), dtype=dtypes.float64, maxval=None) batch_id = random_ops.random_uniform( shape=(3, 1), dtype=dtypes.int64, maxval=65536) with self.assertRaises(errors.InvalidArgumentError): self.evaluate( gen_batch_ops.unbatch_grad( original_input=original_input, batch_index=batch_index, grad=grad, id=batch_id, container="", shared_name="", name=""))
if __name__ == "__main__": test.main()

Related news

GHSA-h5vq-gw2c-pq47: TensorFlow vulnerable to `CHECK` failures in `UnbatchGradOp`

### Impact The [`UnbatchGradOp`](https://github.com/tensorflow/tensorflow/blob/769eddaf479c8debead9a59a72617d6ed6f0fe10/tensorflow/core/kernels/batch_kernels.cc#L891) function takes an argument `id` that is assumed to be a scalar. A nonscalar `id` can trigger a `CHECK` failure and crash the program. ```python import numpy as np import tensorflow as tf # `id` is not scalar tf.raw_ops.UnbatchGrad(original_input= tf.constant([1]),batch_index=tf.constant([[0,0,0 ], ], dtype=tf.int64),grad=tf.constant([1,]),id=tf.constant([1,1,], dtype=tf.int64)) ``` It also requires its argument `batch_index` to contain three times the number of elements as indicated in its `batch_index.dim_size(0)`. An incorrect `batch_index` can trigger a `CHECK` failure and crash the program. ```python import numpy as np import tensorflow as tf # batch_index's size is not 3 tf.raw_ops.UnbatchGrad(original_input= tf.constant([1]),batch_index=tf.constant([[0,0], ], dtype=tf.int64),grad=tf.constant([1,]),id=tf.constant([...

CVE: Latest News

CVE-2023-50976: Transactions API Authorization by oleiman · Pull Request #14969 · redpanda-data/redpanda
CVE-2023-6905
CVE-2023-6903
CVE-2023-6904
CVE-2023-3907