Tensorflow: Out-of-bounds Read
CVE-2022-21728 is a high-severity out-of-bounds read vulnerability in Tensorflow from Google, with a CVSS 3.1 base score of 8.1 out of 10. It can be exploited remotely over the network by an attacker with a low-privileged account, without any action from a user. Affected Tensorflow versions: 2.5.2 and earlier; 2.6.0 through 2.6.2; 2.7.0. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 1.13% chance of exploitation within 30 days, higher than 67% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Check which version of Tensorflow you run against the affected versions below, and install the vendor's latest release.
- Read the advisory on github.com for workarounds and exact fixed builds.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Tensorflow | 2.5.2 and earlier; 2.6.0 through 2.6.2; 2.7.0 | Not stated |
Version data comes from NVD's product matching. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- LowA basic user account is enough.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- NoneNothing can be modified.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 8.1 | High | CNA (github.com) |
| CVSS 3.1 | 8.1 | High | NVD |
| CVSS 2.0 | 5.5 | Medium | NVD |
Official description
Tensorflow is an Open Source Machine Learning Framework. The implementation of shape inference for `ReverseSequence` does not fully validate the value of `batch_dim` and can result in a heap OOB read. There is a check to make sure the value of `batch_dim` does not go over the rank of the input, but there is no check for negative values. Negative dimensions are allowed in some cases to mimic Python's negative indexing (i.e., indexing from the end of the array), however if the value is too negative then the implementation of `Dim` would access elements before the start of an array. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Out-of-bounds Read
The product reads data past the end, or before the beginning, of the intended buffer.
How developers prevent this class of flaw
- Use a language that provides appropriate memory abstractions.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: poc, automatable: no, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Advisories
- github.com/tensorflow/tensorflow/security/advisories/GHSA-6gmv-pjp9-p8w8Third Party Advisory
Patches and release notes
- github.com/tensorflow/tensorflow/commit/37c01fb5e25c3d80213060460196406c43d31995Third Party Advisory
Technical write-ups (may include proof of concept)
- github.com/tensorflow/tensorflow/blob/5100e359aef5c8021f2e71c7b986420b85ce7b3d/tensorflow/core/framework/shap…Exploit, Third Party Advisory
- github.com/tensorflow/tensorflow/blob/5100e359aef5c8021f2e71c7b986420b85ce7b3d/tensorflow/core/ops/array_ops…Exploit, Third Party Advisory
Other vulnerabilities in Tensorflow
- 7.5 High severity
- 8.8 High severity
- 8.1 High severity
- 8.8 High severity
- 8.8 High severity
Recent Out-of-bounds Read vulnerabilities
- 7.8 High severity
- 9.1 Critical severity
- 9.1 Critical severity
- 9.1 Critical severity
- 7.1 High severity
- 7.5 High severity
Spotted an error? Tell us.