xref: /aosp_15_r20/external/tensorflow/tensorflow/security/advisory/tfsa-2021-136.md (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1## TFSA-2021-136: Reference binding to nullptr in boosted trees
2
3### CVE Number
4CVE-2021-37662
5
6### Impact
7An attacker can generate undefined behavior via a reference binding to nullptr
8in `BoostedTreesCalculateBestGainsPerFeature`:
9
10```python
11import tensorflow as tf
12
13tf.raw_ops.BoostedTreesCalculateBestGainsPerFeature(
14  node_id_range=[],
15  stats_summary_list=[[1,2,3]],
16  l1=[1.0],
17  l2=[1.0],
18  tree_complexity =[1.0],
19  min_node_weight =[1.17],
20  max_splits=5)
21```
22
23A similar attack can occur in `BoostedTreesCalculateBestFeatureSplitV2`:
24
25```python
26import tensorflow as tf
27
28tf.raw_ops.BoostedTreesCalculateBestFeatureSplitV2(
29  node_id_range=[],
30  stats_summaries_list=[[1,2,3]],
31  split_types=[''],
32  candidate_feature_ids=[1,2,3,4],
33  l1=[1],
34  l2=[1],
35  tree_complexity=[1.0],
36  min_node_weight=[1.17],
37  logits_dimension=5)
38```
39
40The
41[implementation](https://github.com/tensorflow/tensorflow/blob/84d053187cb80d975ef2b9684d4b61981bca0c41/tensorflow/core/kernels/boosted_trees/stats_ops.cc)
42does not validate the input values.
43
44### Patches
45We have patched the issue in GitHub commit
46[9c87c32c710d0b5b53dc6fd3bfde4046e1f7a5ad](https://github.com/tensorflow/tensorflow/commit/9c87c32c710d0b5b53dc6fd3bfde4046e1f7a5ad)
47and in commit.
48[429f009d2b2c09028647dd4bb7b3f6f414bbaad7](https://github.com/tensorflow/tensorflow/commit/429f009d2b2c09028647dd4bb7b3f6f414bbaad7).
49
50The fix will be included in TensorFlow 2.6.0. We will also cherrypick this
51commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are
52also affected and still in supported range.
53
54### For more information
55Please consult [our security
56guide](https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) for
57more information regarding the security model and how to contact us with issues
58and questions.
59
60### Attribution
61This vulnerability has been reported by members of the Aivul Team from Qihoo
62360.
63