555 matches found
Abort caused by allocating a vector that is too large in Tensorflow
Impact During shape inference, TensorFlow can allocate a large vector based on a value from a tensor controlled by the user: cc const auto numdims = Valueshapedim; std::vector dims; dims.reservenumdims; Patches We have patched the issue in GitHub commit 1361fb7e29449629e1df94d44e0427ebec8c83c7. T...
`CHECK`-failures during Grappler's `IsSimplifiableReshape` in Tensorflow
Impact The Grappler optimizer in TensorFlow can be used to cause a denial of service by altering a SavedModel such that IsSimplifiableReshape would trigger CHECK failures. Patches We have patched the issue in GitHub commits ebc1a2ffe5a7573d905e99bd0ee3568ee07c12c1,...
Crash in `tf.math.segment_*` operations
Impact The implementation of tf.math.segment operations results in a CHECK-fail related abort and denial of service if a segment id in segmentids is large. python import tensorflow as tf tf.math.segmentmaxdata=np.ones1,10,1, segmentids=1676240524292489355 tf.math.segmentmindata=np.ones1,10,1,...
Crash in `max_pool3d` when size argument is 0 or negative
Impact The Keras pooling layers can trigger a segfault if the size of the pool is 0 or if a dimension is negative: python import tensorflow as tf poolsize = 2, 2, 0 layer = tf.keras.layers.MaxPooling3Dstrides=1, poolsize=poolsize inputtensor = tf.random.uniform3, 4, 10, 11, 12, dtype=tf.float32 r...
Overflow/crash in `tf.tile` when tiling tensor is large
Impact If tf.tile is called with a large input argument then the TensorFlow process will crash due to a CHECK-failure caused by an overflow. python import tensorflow as tf import numpy as np tf.keras.backend.tilex=np.ones1,1,1, n=100000000,100000000, 100000000 The number of elements in the output...
Overflow/crash in `tf.image.resize` when size is large
Impact If tf.image.resize is called with a large input argument then the TensorFlow process will crash due to a CHECK-failure caused by an overflow. python import tensorflow as tf import numpy as np tf.keras.layers.UpSampling2D size=1610637938, dataformat='channelsfirst',...
Incomplete validation in `tf.summary.create_file_writer`
Impact If tf.summary.createfilewriter is called with non-scalar arguments code crashes due to a CHECK-fail. python import tensorflow as tf import numpy as np tf.summary.createfilewriterlogdir='', flushmillis=np.ones1,2 Patches We have patched the issue in GitHub commit...
Overflow/crash in `tf.range`
Impact While calculating the size of the output within the tf.range kernel, there is a conditional statement of type int64 = condition ? int64 : double. Due to C++ implicit conversion rules, both branches of the condition will be cast to double and the result would be truncated before the...
GHSA-XRQM-FPGR-6HHX Overflow/crash in `tf.range`
Impact While calculating the size of the output within the tf.range kernel, there is a conditional statement of type int64 = condition ? int64 : double. Due to C++ implicit conversion rules, both branches of the condition will be cast to double and the result would be truncated before the...
Missing validation during checkpoint loading
Impact An attacker can trigger undefined behavior, integer overflows, segfaults and CHECK-fail crashes if they can change saved checkpoints from outside of TensorFlow. This is because the checkpoints loading infrastructure is missing validation for invalid file formats. Patches We have patched th...
Segfault while copying constant resource tensor
Impact During TensorFlow's Grappler optimizer phase, constant folding might attempt to deep copy a resource tensor. This results in a segfault, as these tensors are supposed to not change. Patches We have patched the issue in GitHub commit 7731e8dfbe4a56773be5dc94d631611211156659. The fix will be...
FPE in `ParallelConcat`
Impact The implementation of ParallelConcat misses some input validation and can produce a division by 0: python import tensorflow as tf @tf.function def test: y = tf.rawops.ParallelConcatvalues='tf',shape=0 return y test Patches We have patched the issue in GitHub commit...
Deadlock in mutually recursive `tf.function` objects
Impact The code behind tf.function API can be made to deadlock when two tf.function decorated Python functions are mutually recursive: python import tensorflow as tf @tf.function def fun1num: if num == 1: return printnum fun2num-1 @tf.function def fun2num: if num == 0: return printnum fun1num-1...
Reference binding to `nullptr` in `tf.ragged.cross`
Impact The shape inference code for tf.ragged.cross has an undefined behavior due to binding a reference to nullptr. In the following scenario, this results in a crash: python import tensorflow as tf @tf.function def test: y = tf.ragged.crosstf.ragged.constant'1','2' return y test Patches We have...
Null pointer exception in `DeserializeSparse`
Impact The shape inference code for DeserializeSparse can trigger a null pointer dereference: python import tensorflow as tf dataset = tf.data.Dataset.range3 @tf.function def test: y = tf.rawops.DeserializeSparse serializedsparse=tf.data.experimental.tovariantdataset, dtype=tf.int32 test This is...
Null pointer exception when `Exit` node is not preceded by `Enter` op
Impact The process of building the control flow graph for a TensorFlow model is vulnerable to a null pointer exception when nodes that should be paired are not: python import tensorflow as tf @tf.function def func: return tf.rawops.Exitdata=False,False func This occurs because the code assumes th...
Integer division by 0 in `tf.raw_ops.AllToAll`
Impact The shape inference code for AllToAll can be made to execute a division by 0: python import tensorflow as tf @tf.function def func: return tf.rawops.AllToAll input=0.0, 0.1652, 0.6543, groupassignment=1, -1, concatdimension=0, splitdimension=0, splitcount=0 func This occurs whenever the...
Undefined behavior via `nullptr` reference binding in sparse matrix multiplication
Impact The code for sparse matrix multiplication is vulnerable to undefined behavior via binding a reference to nullptr: python import tensorflow as tf tf.rawops.SparseMatMul a=1.0,1.0,1.0, b=,,, transposea=False, transposeb=False, aissparse=False, bissparse=True This occurs whenever the dimensio...
Segfault due to negative splits in `SplitV`
Impact The implementation of SplitV can trigger a segfault is an attacker supplies negative arguments: python import tensorflow as tf tf.rawops.SplitV value=tf.constant, sizesplits=-1, -2 ,axis=0, numsplit=2 This occurs whenever sizesplits contains more than one value and at least one value is...
Heap OOB in `FusedBatchNorm` kernels
Impact The implementation of FusedBatchNorm kernels is vulnerable to a heap OOB: python import tensorflow as tf tf.rawops.FusedBatchNormGrad ybackprop=tf.constanti for i in range9,shape=1,1,3,3,dtype=tf.float32 x=tf.constanti for i in range2,shape=1,1,1,2,dtype=tf.float32 scale=1,1,...