CVE-2021-29516: TensorFlow - Null Pointer Dereference
- Cve: CVE-2021-29516
- Name: TensorFlow - Null Pointer Dereference
- Description: TensorFlow is an end-to-end open source platform for machine learning. Calling `tf.raw_ops.RaggedTensorToVariant` with arguments specifying an invalid ragged tensor results in a null pointer dereference. The implementation of `RaggedTensorToVariant` operations(https://github.com/tensorflow/tensorflow/blob/904b3926ed1c6c70380d5313d282d248a776baa1/tensorflow/core/kernels/ragged_tensor_to_variant_op.cc#L39-L40) does not validate that the ragged tensor argument is non-empty. Since `batched_ragged` contains no elements, `batched_ragged.splits` is a null vector, thus `batched_ragged.splits(0)` will result in dereferencing `nullptr`. 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.
- Impact: Attackers can cause application crashes or undefined behavior, potentially leading to denial of service or arbitrary code execution.
- Remediation: Update to TensorFlow 2.5.0 or apply the patch to affected versions (2.4.2, 2.3.3, 2.2.3, 2.1.4).
- Vulnerability type: null_pointer_dereference
- Vulnerability impact: denial_of_service, remote_code_execution
- Requirement type: none
- Labels source: projectdiscovery
- Severity: medium
- Cvss score: 5.5
- Cvss vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- Epss score: 0.00198
- Epss percentile: 0.09481
- Assignee: [email protected]
- Published at: 2021-05-14T20:15:11Z
- Age in days: 2020
- Modified at: 2026-06-17T03:47:48Z
- Patch available: yes
- Public exploits total: 1
- References total: 2
- Products total: 1
- Oss: yes
- Projects total: 1
- Advisory url: https://nvd.nist.gov/vuln/detail/CVE-2021-29516
- Nvd status: modified
- Checked, none or zero: known exploited entries, nuclei templates, public exploits capped, rejected by nvd
- Not known: requirements, hackerone
Cwe
| Id | Name |
|---|---|
| CWE-476 | NULL Pointer Dereference |
Public exploits
| Url | Source | Added date |
|---|---|---|
| https://github.com/tensorflow/tensorflow/security/advisories/GHSA-84mw-34w6-2q43 | nvd | 2021-05-14 |
References
| Url | Source | Tags |
|---|---|---|
| https://github.com/tensorflow/tensorflow/commit/b055b9c474cd376259dde8779908f9eeaf097d93 | nvd | Patch, Third Party Advisory |
| https://github.com/tensorflow/tensorflow/security/advisories/GHSA-84mw-34w6-2q43 | nvd | Exploit, Patch, Third Party Advisory |
Products
| Product | Affected | Platform bound | Sources | Url |
|---|---|---|---|---|
| google:tensorflow | >= 2.4.0, < 2.4.2; >= 2.3.0, < 2.3.3; >= 2.2.0, < 2.2.3; < 2.1.4 | no | nvd | /v1/products/google/tensorflow |
Projects
| Repository | Link kinds | Indexed | Url |
|---|---|---|---|
| tensorflow/tensorflow | commit, fix, security_advisory | yes | /v1/repositories/tensorflow/tensorflow |
Index
- Repositories: 331
- Repositories high signal: 130
- Packages: 3
Exploitation
- Public exploit: yes
- Public exploit count: 1
- Public exploit first date: 2021-05-14
- Authentication required: yes
- Checked, none or zero: known exploited, known exploited by, exploitation seen, initial access, remote
- Not known: known exploited since, vulncheck known exploited since, nuclei template, initial access since, hackerone reports, exposed hosts