Update dependency tensorflow-gpu to v2 [SECURITY] #193
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==1.14.0
->==2.4.0
GitHub Vulnerability Alerts
CVE-2020-5215
Impact
Converting a string (from Python) to a
tf.float16
value results in a segmentation fault in eager mode as the format checks for this use case are only in the graph mode.This issue can lead to denial of service in inference/training where a malicious attacker can send a data point which contains a string instead of a
tf.float16
value.Similar effects can be obtained by manipulating saved models and checkpoints whereby replacing a scalar
tf.float16
value with a scalar string will trigger this issue due to automatic conversions.This can be easily reproduced by
tf.constant("hello", tf.float16)
, if eager execution is enabled.Patches
We have patched the vulnerability in GitHub commit 5ac1b9.
We are additionally releasing TensorFlow 1.15.1 and 2.0.1 with this vulnerability patched.
TensorFlow 2.1.0 was released after we fixed the issue, thus it is not affected.
We encourage users to switch to TensorFlow 1.15.1, 2.0.1 or 2.1.0.
For more information
Please consult
SECURITY.md
for more information regarding the security model and how to contact us with issues and questions.CVE-2020-15190
Impact
The
tf.raw_ops.Switch
operation takes as input a tensor and a boolean and outputs two tensors. Depending on the boolean value, one of the tensors is exactly the input tensor whereas the other one should be an empty tensor.However, the eager runtime traverses all tensors in the output:
https://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/core/common_runtime/eager/kernel_and_device.cc#L308-L313
Since only one of the tensors is defined, the other one is
nullptr
, hence we are binding a reference tonullptr
. This is undefined behavior and reported as an error if compiling with-fsanitize=null
. In this case, this results in a segmentation faultPatches
We have patched the issue in da8558533d925694483d2c136a9220d6d49d843c and will release a patch release for all affected versions.
We recommend users to upgrade to TensorFlow 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.
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 members of the Aivul Team from Qihoo 360.
CVE-2020-15194
Impact
The
SparseFillEmptyRowsGrad
implementation has incomplete validation of the shapes of its arguments:https://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/core/kernels/sparse_fill_empty_rows_op.cc#L235-L241
Although
reverse_index_map_t
andgrad_values_t
are accessed in a similar pattern, onlyreverse_index_map_t
is validated to be of proper shape. Hence, malicious users can pass a badgrad_values_t
to trigger an assertion failure invec
, causing denial of service in serving installations.Patches
We have patched the issue in 390611e0d45c5793c7066110af37c8514e6a6c54 and will release a patch release for all affected versions.
We recommend users to upgrade to TensorFlow 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.
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 is a variant of GHSA-63xm-rx5p-xvqr
CVE-2020-15195
Impact
The implementation of
SparseFillEmptyRowsGrad
uses a double indexing pattern:https://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/core/kernels/sparse_fill_empty_rows_op.cc#L263-L269
It is possible for
reverse_index_map(i)
to be an index outside of bounds ofgrad_values
, thus resulting in a heap buffer overflow.Patches
We have patched the issue in 390611e0d45c5793c7066110af37c8514e6a6c54 and will release a patch release for all affected versions.
We recommend users to upgrade to TensorFlow 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.
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 members of the Aivul Team from Qihoo 360.
CVE-2020-15202
Impact
The
Shard
API in TensorFlow expects the last argument to be a function taking twoint64
(i.e.,long long
) arguments:https://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/core/util/work_sharder.h#L59-L60
However, there are several places in TensorFlow where a lambda taking
int
orint32
arguments is being used:https://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/core/kernels/random_op.cc#L204-L205
https://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/core/kernels/random_op.cc#L317-L318
In these cases, if the amount of work to be parallelized is large enough, integer truncation occurs. Depending on how the two arguments of the lambda are used, this can result in segfaults, read/write outside of heap allocated arrays, stack overflows, or data corruption.
Patches
We have patched the issue in 27b417360cbd671ef55915e4bb6bb06af8b8a832 and ca8c013b5e97b1373b3bb1c97ea655e69f31a575. We will release patch releases for all versions between 1.15 and 2.3.
We recommend users to upgrade to TensorFlow 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.
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 members of the Aivul Team from Qihoo 360.
CVE-2020-15203
Impact
By controlling the
fill
argument oftf.strings.as_string
, a malicious attacker is able to trigger a format string vulnerability due to the way the internal format use in aprintf
call is constructed: https://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/core/kernels/as_string_op.cc#L68-L74This can result in unexpected output:
However, passing in
n
ors
results in segmentation fault.Patches
We have patched the issue in 33be22c65d86256e6826666662e40dbdfe70ee83 and will release patch releases for all versions between 1.15 and 2.3.
We recommend users to upgrade to TensorFlow 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.
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 members of the Aivul Team from Qihoo 360.
CVE-2020-15205
Impact
The
data_splits
argument oftf.raw_ops.StringNGrams
lacks validation. This allows a user to pass values that can cause heap overflow errors and even leak contents of memoryAll the binary strings after
ee ff
are contents from the memory stack. Since these can contain return addresses, this data leak can be used to defeat ASLR.Patches
We have patched the issue in 0462de5b544ed4731aa2fb23946ac22c01856b80 and will release patch releases for all versions between 1.15 and 2.3.
We recommend users to upgrade to TensorFlow 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.
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 members of the Aivul Team from Qihoo 360.
CVE-2020-15206
Impact
Changing the TensorFlow's
SavedModel
protocol buffer and altering the name of required keys results in segfaults and data corruption while loading the model. This can cause a denial of service in products usingtensorflow-serving
or other inference-as-a-service installments.We have added fixes to this in f760f88b4267d981e13f4b302c437ae800445968 and fcfef195637c6e365577829c4d67681695956e7d (both going into TensorFlow 2.2.0 and 2.3.0 but not yet backported to earlier versions). However, this was not enough, as #41097 reports a different failure mode.
Patches
We have patched the issue in adf095206f25471e864a8e63a0f1caef53a0e3a6 and will release patch releases for all versions between 1.15 and 2.3. Patch releases for versions between 1.15 and 2.1 will also contain cherry-picks of f760f88b4267d981e13f4b302c437ae800445968 and fcfef195637c6e365577829c4d67681695956e7d.
We recommend users to upgrade to TensorFlow 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.
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 Shuaike Dong, from Alipay Tian Qian Security Lab && Lab for Applied Security Research, CUHK.
CVE-2020-15204
Impact
In eager mode, TensorFlow does not set the session state. Hence, calling
tf.raw_ops.GetSessionHandle
ortf.raw_ops.GetSessionHandleV2
results in a null pointer dereference:https://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/core/kernels/session_ops.cc#L45
In the above snippet, in eager mode,
ctx->session_state()
returnsnullptr
. Since code immediately dereferences this, we get a segmentation fault.Patches
We have patched the issue in 9a133d73ae4b4664d22bd1aa6d654fec13c52ee1 and will release patch releases for all versions between 1.15 and 2.3.
We recommend users to upgrade to TensorFlow 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.
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 members of the Aivul Team from Qihoo 360.
CVE-2020-15207
Impact
To mimic Python's indexing with negative values, TFLite uses
ResolveAxis
to convert negative values to positive indices. However, the only check that the converted index is now valid is only present in debug builds:https://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/lite/kernels/internal/reference/reduce.h#L68-L72
If the
DCHECK
does not trigger, then code execution moves ahead with a negative index. This, in turn, results in accessing data out of bounds which results in segfaults and/or data corruption.Patches
We have patched the issue in 2d88f470dea2671b430884260f3626b1fe99830a and will release patch releases for all versions between 1.15 and 2.3.
We recommend users to upgrade to TensorFlow 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.
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 members of the Aivul Team from Qihoo 360.
CVE-2020-15208
Impact
When determining the common dimension size of two tensors, TFLite uses a
DCHECK
which is no-op outside of debug compilation modes:https://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/lite/kernels/internal/types.h#L437-L442
Since the function always returns the dimension of the first tensor, malicious attackers can craft cases where this is larger than that of the second tensor. In turn, this would result in reads/writes outside of bounds since the interpreter will wrongly assume that there is enough data in both tensors.
Patches
We have patched the issue in 8ee24e7949a20 and will release patch releases for all versions between 1.15 and 2.3.
We recommend users to upgrade to TensorFlow 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.
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 members of the Aivul Team from Qihoo 360.
CVE-2020-15209
Impact
A crafted TFLite model can force a node to have as input a tensor backed by a
nullptr
buffer. This can be achieved by changing a buffer index in the flatbuffer serialization to convert a read-only tensor to a read-write one. The runtime assumes that these buffers are written to before a possible read, hence they are initialized withnullptr
:https://github.com/tensorflow/tensorflow/blob/0e68f4d3295eb0281a517c3662f6698992b7b2cf/tensorflow/lite/core/subgraph.cc#L1224-L1227
However, by changing the buffer index for a tensor and implicitly converting that tensor to be a read-write one, as there is nothing in the model that writes to it, we get a null pointer dereference.
Patches
We have patched the issue in 0b5662bc and will release patch releases for all versions between 1.15 and 2.3.
We recommend users to upgrade to TensorFlow 1.15.4, 2.0.3, 2.1.2, 2.2.1, or 2.3.1.
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 members of the Aivul Team from Qihoo 360 but was also discovered through variant analysis of GHSA-cvpc-8phh-8f45.
CVE-2020-15265
Impact
An attacker can pass an invalid
axis
value totf.quantization.quantize_and_dequantize
:This results in accessing a dimension outside the rank of the input tensor in the C++ kernel implementation:
However,
dim_size
only does aDCHECK
to validate the argument and then uses it to access the corresponding element of an array:Since in normal builds,
DCHECK
-like macros are no-ops, this results in segfault and access out of bounds of the array.Patches
We have patched the issue in eccb7ec454e6617738554a255d77f08e60ee0808 and will release TensorFlow 2.4.0 containing the patch. TensorFlow nightly packages after this commit will also have the issue resolved.
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 in #42105
CVE-2020-15266
Impact
When the
boxes
argument oftf.image.crop_and_resize
has a very large value, the CPU kernel implementation receives it as a C++nan
floating point value. Attempting to operate on this is undefined behavior which later produces a segmentation fault.Patches
We have patched the issue in c0319231333f0f16e1cc75ec83660b01fedd4182 and will release TensorFlow 2.4.0 containing the patch. TensorFlow nightly packages after this commit will also have the issue resolved.
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 in #42129
CVE-2020-26266
Impact
Under certain cases, a saved model can trigger use of uninitialized values during code execution. This is caused by having tensor buffers be filled with the default value of the type but forgetting to default initialize the quantized floating point types in Eigen:
Patches
We have patched the issue in GitHub commit ace0c15a22f7f054abcc1f53eabbcb0a1239a9e2 and will release TensorFlow 2.4.0 containing the patch. TensorFlow nightly packages after this commit will also have the issue resolved.
Since this issue also impacts TF versions before 2.4, we will patch all releases between 1.15 and 2.3 inclusive.
For more information
Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.
CVE-2020-26267
Impact
The
tf.raw_ops.DataFormatVecPermute
API does not validate thesrc_format
anddst_format
attributes. The code assumes that these two arguments define a permutation ofNHWC
.However, these assumptions are not checked and this can result in uninitialized memory accesses, read outside of bounds and even crashes.
A similar issue occurs in
tf.raw_ops.DataFormatDimMap
, for the same reasons:Patches
We have patched the issue in GitHub commit ebc70b7a592420d3d2f359e4b1694c236b82c7ae and will release TensorFlow 2.4.0 containing the patch. TensorFlow nightly packages after this commit will also have the issue resolved.
Since this issue also impacts TF versions before 2.4, we will patch all releases between 1.15 and 2.3 inclusive.
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 members of the Aivul Team from Qihoo 360.
CVE-2020-26268
Impact
The
tf.raw_ops.ImmutableConst
operation returns a constant tensor created from a memory mapped file which is assumed immutable. However, if the type of the tensor is not an integral type, the operation crashes the Python interpreter as it tries to write to the memory area:If the file is too small, TensorFlow properly returns an error as the memory area has fewer bytes than what is needed for the tensor it creates. However, as soon as there are enough bytes, the above snippet causes a segmentation fault.
This is because the alocator used to return the buffer data is not marked as returning an opaque handle since the needed virtual method is not overriden.
Patches
We have patched the issue in GitHub commit c1e1fc899ad5f8c725dcbb6470069890b5060bc7 and will release TensorFlow 2.4.0 containing the patch. TensorFlow nightly packages after this commit will also have the issue resolved.
Since this issue also impacts TF versions before 2.4, we will patch all releases between 1.15 and 2.3 inclusive.
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 members of the Aivul Team from Qihoo 360.
CVE-2020-26270
Impact
Running an LSTM/GRU model where the LSTM/GRU layer receives an input with zero-length results in a
CHECK
failure when using the CUDA backend.This can result in a query-of-death vulnerability, via denial of service, if users can control the input to the layer.
Patches
We have patched the issue in GitHub commit 14755416e364f17fb1870882fa778c7fec7f16e3 and will release TensorFlow 2.4.0 containing the patch. TensorFlow nightly packages after this commit will also have the issue resolved.
Since this issue also impacts TF versions before 2.4, we will patch all releases between 1.15 and 2.3 inclusive.
For more information
Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.
CVE-2020-26271
Impact
Under certain cases, loading a saved model can result in accessing uninitialized memory while building the computation graph. The
MakeEdge
function creates an edge between one output tensor of thesrc
node (given byoutput_index
) and the input slot of thedst
node (given byinput_index
). This is only possible if the types of the tensors on both sides coincide, so the function begins by obtaining the correspondingDataType
values and comparing these for equality:However, there is no check that the indices point to inside of the arrays they index into. Thus, this can result in accessing data out of bounds of the corresponding heap allocated arrays.
In most scenarios, this can manifest as unitialized data access, but if the index points far away from the boundaries of the arrays this can be used to leak addresses from the library.
Patches
We have patched the issue in GitHub commit 0cc38aaa4064fd9e79101994ce9872c6d91f816b and will release TensorFlow 2.4.0 containing the patch. TensorFlow nightly packages after this commit will also have the issue resolved.
Since this issue also impacts TF versions before 2.4, we will patch all releases between 1.15 and 2.3 inclusive.
For more information
Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.
CVE-2021-29619
Impact
Passing invalid arguments (e.g., discovered via fuzzing) to
tf.raw_ops.SparseCountSparseOutput
results in segfault.Patches
We have patched the issue in GitHub commit 82e6203221865de4008445b13c69b6826d2b28d9.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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.
CVE-2021-29618
Impact
Passing a complex argument to
tf.transpose
at the same time as passingconjugate=True
argument results in a crash:Patches
We have received a patch for the issue in GitHub commit 1dc6a7ce6e0b3e27a7ae650bfc05b195ca793f88.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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 in #42105 and fixed in #46973.
CVE-2021-29617
Impact
An attacker can cause a denial of service via
CHECK
-fail intf.strings.substr
with invalid arguments:Patches
We have received a patch for the issue in GitHub commit 890f7164b70354c57d40eda52dcdd7658677c09f.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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 in #46900 and fixed in #46974.
CVE-2021-29616
Impact
The implementation of
TrySimplify
has undefined behavior due to dereferencing a null pointer in corner cases thatresult in optimizing a node with no inputs.
Patches
We have patched the issue in GitHub commit e6340f0665d53716ef3197ada88936c2a5f7a2d3.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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.
CVE-2021-29615
Impact
The implementation of
ParseAttrValue
can be tricked into stack overflow due to recursion by giving in a specially crafted input.Patches
We have patched the issue in GitHub commit e07e1c3d26492c06f078c7e5bf2d138043e199c1.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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.
CVE-2021-29614
Impact
The implementation of
tf.io.decode_raw
produces incorrect results and crashes the Python interpreter when combiningfixed_length
and wider datatypes.The implementation of the padded version is buggy due to a confusion about pointer arithmetic rules.
First, the code computes the width of each output element by dividing the
fixed_length
value to the size of the type argument:The
fixed_length
argument is also used to determine the size needed for the output tensor:This is followed by reencoding code:
The erroneous code is the last line above: it is moving the
out_data
pointer byfixed_length * sizeof(T)
bytes whereas it only copied at mostfixed_length
bytes from the input. This results in parts of the input not being decoded into the output.Furthermore, because the pointer advance is far wider than desired, this quickly leads to writing to outside the bounds of the backing data. This OOB write leads to interpreter crash in the reproducer mentioned here, but more severe attacks can be mounted too, given that this gadget allows writing to periodically placed locations in memory.
Patches
We have patched the issue in GitHub commit 698e01511f62a3c185754db78ebce0eee1f0184d.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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.
CVE-2021-29613
Impact
Incomplete validation in
tf.raw_ops.CTCLoss
allows an attacker to trigger an OOB read from heap:An attacker can also trigger a heap buffer overflow:
Finally, an attacker can trigger a null pointer dereference:
Patches
We have patched the issue in GitHub commit14607c0707040d775e06b6817325640cb4b5864c followed by GitHub commit 4504a081af71514bb1828048363e6540f797005b.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick these commits on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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 Yakun Zhang and Ying Wang of Baidu X-Team.
CVE-2021-29612
Impact
An attacker can trigger a heap buffer overflow in Eigen implementation of
tf.raw_ops.BandedTriangularSolve
:The implementation calls
ValidateInputTensors
for input validation but fails to validate that the two tensors are not empty:Furthermore, since
OP_REQUIRES
macro only stops execution of current function after settingctx->status()
to a non-OK value, callers of helper functions that useOP_REQUIRES
must check value ofctx->status()
before continuing. This doesn't happen in this op's implementation, hence the validation that is present is also not effective.Patches
We have patched the issue in GitHub commit ba6822bd7b7324ba201a28b2f278c29a98edbef2 followed by GitHub commit 0ab290774f91a23bebe30a358fde4e53ab4876a0.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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 Ye Zhang and Yakun Zhang of Baidu X-Team.
CVE-2021-29610
Impact
The validation in
tf.raw_ops.QuantizeAndDequantizeV2
allows invalid values foraxis
argument:The validation uses
||
to mix two different conditions:If
axis_ < -1
the condition inOP_REQUIRES
will still be true, but this value ofaxis_
results in heap underflow. This allows attackers to read/write to other data on the heap.Patches
We have patched the issue in GitHub commit c5b0d5f8ac19888e46ca14b0e27562e7fbbee9a9.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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 Yakun Zhang and Ying Wang of Baidu X-Team.
CVE-2021-29609
Impact
Incomplete validation in
SparseAdd
results in allowing attackers to exploit undefined behavior (dereferencing null pointers) as well as write outside of bounds of heap allocated data:The implementation has a large set of validation for the two sparse tensor inputs (6 tensors in total), but does not validate that the tensors are not empty or that the second dimension of
*_indices
matches the size of corresponding*_shape
. This allows attackers to send tensor triples that represent invalid sparse tensors to abuse code assumptions that are not protected by validation.Patches
We have patched the issue in GitHub commit 6fd02f44810754ae7481838b6a67c5df7f909ca3 followed by GitHub commit 41727ff06111117bdf86b37db198217fd7a143cc.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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 Yakun Zhang and Ying Wang of Baidu X-Team.
CVE-2021-29608
Impact
Due to lack of validation in
tf.raw_ops.RaggedTensorToTensor
, an attacker can exploit an undefined behavior if input arguments are empty:The implementation only checks that one of the tensors is not empty, but does not check for the other ones.
There are multiple
DCHECK
validations to prevent heap OOB, but these are no-op in release builds, hence they don't prevent anything.Patches
We have patched the issue in GitHub commit b761c9b652af2107cfbc33efd19be0ce41daa33e followed by GitHub commit f94ef358bb3e91d517446454edff6535bcfe8e4a and GitHub commit c4d7afb6a5986b04505aca4466ae1951686c80f6.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick these commits on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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 Yakun Zhang and Ying Wang of Baidu X-Team.
CVE-2021-29595
Impact
The implementation of the
DepthToSpace
TFLite operator is vulnerable to a division by zero error:An attacker can craft a model such that
params->block_size
is 0.Patches
We have patched the issue in GitHub commit 106d8f4fb89335a2c52d7c895b7a7485465ca8d9.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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 members of the Aivul Team from Qihoo 360.
CVE-2021-29584
Impact
An attacker can trigger a denial of service via a
CHECK
-fail in caused by an integer overflow in constructing a new tensor shape:This is because the implementation builds a dense shape without checking that the dimensions would not result in overflow:
The
TensorShape
constructor uses aCHECK
operation which triggers whenInitDims
returns a non-OK status.In our scenario, this occurs when adding a dimension from the argument results in overflow:
This is a legacy implementation of the constructor and operations should use
BuildTensorShapeBase
orAddDimWithStatus
to preventCHECK
-failures in the presence of overflows.Patches
We have patched the issue in GitHub commit 4c0ee937c0f61c4fc5f5d32d9bb4c67428012a60.
The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.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 researchers from University of Virginia and University of California, Santa Barbara.
CVE-2021-29583
Impact
The implementation of
tf.raw_ops.FusedBatchNorm
is vulnerable to a heap buffer overflow:If the tensors are empty, the same implementation can trigger undefined behavior by dereferencing null pointers: