CVE-2022-23592: Tensorflow Out Of Bounds Read Vulnerability

HIGH
Advisory Identifier: GHSA-vq36-27g6-p492
CVSS 8.1
CWE-125
Published
Advisory Summary

CVE-2022-23592 is a HIGH (CVSS 8.1) out of bounds read vulnerability (CWE-125: Out-of-bounds Read) affecting Tensorflow libraries in the PyPI ecosystem. The issue involves out of bounds read in tensorflow. Remediation is available by upgrading affected packages to version 2.8.0.

CVE-2022-23592 at a Glance

CVE Identifier CVE-2022-23592
GHSA Identifier GHSA-vq36-27g6-p492
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-125: Out-of-bounds Read
Affected Product Tensorflow
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2022-23592

To remediate this vulnerability, upgrade all affected Tensorflow dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

tensorflow fixed: 2.8.0
pip install tensorflow>=2.8.0
tensorflow-cpu fixed: 2.8.0
pip install tensorflow-cpu>=2.8.0
tensorflow-gpu fixed: 2.8.0
pip install tensorflow-gpu>=2.8.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show tensorflow

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2022-23592, inspect your installed packages using pip:

pip show tensorflow

Analyze the terminal output to locate any version of Tensorflow in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.8.0), your application is affected.

Note: The pip show tensorflow command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Tensorflow, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact TensorFlow's [type inference](https://github.com/tensorflow/tensorflow/blob/274df9b02330b790aa8de1cee164b70f72b9b244/tensorflow/core/graph/graph.cc#L223-L229) can cause a heap OOB read as the bounds checking is done in a `DCHECK` (which is a no-op during production): ```cc if (node_t.type_id() != TFT_UNSET) { int ix = input_idx[i]; DCHECK(ix < node_t.args_size()) << "input " << i << " should have an output " << ix << " but instead only has " << node_t.args_size() << " outputs: " << node_t.DebugString(); input_types.emplace_back(node_t.args(ix)); // ... } ``` An attacker can control `input_idx` such that `ix` would be larger than the number of values in `node_t.args`. ### Patches We have patched the issue in GitHub commit [c99d98cd189839dcf51aee94e7437b54b31f8abd](https://github.com/tensorflow/tensorflow/commit/c99d98cd189839dcf51aee94e7437b54b31f8abd). The fix will be included in TensorFlow 2.8.0. This is the only affected version. ### For more information Please consult [our security guide](https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) for more information regarding the security model and how to contact us with issues and questions.

CVE-2022-23592 Affected Tensorflow Versions

3 component(s)
Fixed Versions:
2.8.0
Product / Package Ecosystem Affected Versions Fixed Version
tensorflow
PyPI
≥ 2.8.0-rc0
< 2.8.0
All 1 versions
2.8.0-rc0
2.8.0
tensorflow-cpu
PyPI
≥ 2.8.0-rc0
< 2.8.0
All 1 versions
2.8.0-rc0
2.8.0
tensorflow-gpu
PyPI
≥ 2.8.0-rc0
< 2.8.0
All 1 versions
2.8.0-rc0
2.8.0

References

Frequently Asked Questions

What is CVE-2022-23592?
CVE-2022-23592 is a security vulnerability in Tensorflow involving Out of bounds read in Tensorflow under CWE-125: Out-of-bounds Read.
Which Tensorflow versions are affected?
Affected versions include releases prior to 2.8.0 across affected packages: tensorflow, tensorflow-cpu, tensorflow-gpu.
What version fixes CVE-2022-23592?
Upgrading to 2.8.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tensorflow affected?
Yes, tensorflow is affected in releases prior to 2.8.0. Upgrade your dependency to 2.8.0 or later.
Is tensorflow-cpu affected?
Yes, tensorflow-cpu is affected in releases prior to 2.8.0. Upgrade your dependency to 2.8.0 or later.
What is the CVSS score of CVE-2022-23592?
CVE-2022-23592 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H.
What CWE is associated with CVE-2022-23592?
CVE-2022-23592 is classified under CWE-125: Out-of-bounds Read (The product reads data past the end, or before the beginning, of the intended buffer.).
How can I check PyPI dependencies for CVE-2022-23592?
Run the dependency tree command: 'pip show tensorflow'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vq36-27g6-p492",
  "modified" : "2024-11-13T22:16:04Z",
  "published" : "2022-02-09T23:31:48Z",
  "aliases" : [ "CVE-2022-23592" ],
  "summary" : "Out of bounds read in Tensorflow",
  "details" : "### Impact\nTensorFlow's [type inference](https://github.com/tensorflow/tensorflow/blob/274df9b02330b790aa8de1cee164b70f72b9b244/tensorflow/core/graph/graph.cc#L223-L229) can cause a heap OOB read as the bounds checking is done in a `DCHECK` (which is a no-op during production):\n\n```cc\nif (node_t.type_id() != TFT_UNSET) {\n  int ix = input_idx[i];\n  DCHECK(ix < node_t.args_size())\n      << \"input \" << i << \" should have an output \" << ix\n      << \" but instead only has \" << node_t.args_size()\n      << \" outputs: \" << node_t.DebugString();\n  input_types.emplace_back(node_t.args(ix));\n  // ...\n}       \n```   \n      \nAn attacker can control `input_idx` such that `ix` would be larger than the number of values in `node_t.args`.\n        \n### Patches\nWe have patched the issue in GitHub commit [c99d98cd189839dcf51aee94e7437b54b31f8abd](https://github.com/tensorflow/tensorflow/commit/c99d98cd189839dcf51aee94e7437b54b31f8abd).\n  \nThe fix will be included in TensorFlow 2.8.0. This is the only affected version.\n\n### For more information\nPlease consult [our security guide](https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) for more information regarding the security model and how to contact us with issues and questions.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tensorflow"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.8.0-rc0"
      }, {
        "fixed" : "2.8.0"
      } ]
    } ],
    "versions" : [ "2.8.0-rc0" ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tensorflow-cpu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.8.0-rc0"
      }, {
        "fixed" : "2.8.0"
      } ]
    } ],
    "versions" : [ "2.8.0-rc0" ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tensorflow-gpu"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.8.0-rc0"
      }, {
        "fixed" : "2.8.0"
      } ]
    } ],
    "versions" : [ "2.8.0-rc0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/tensorflow/tensorflow/security/advisories/GHSA-vq36-27g6-p492"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-23592"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tensorflow/tensorflow/commit/c99d98cd189839dcf51aee94e7437b54b31f8abd"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-cpu/PYSEC-2022-101.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/tensorflow-gpu/PYSEC-2022-156.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tensorflow/tensorflow"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tensorflow/tensorflow/blob/274df9b02330b790aa8de1cee164b70f72b9b244/tensorflow/core/graph/graph.cc#L223-L229"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-125" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-02-04T18:17:17Z",
    "nvd_published_at" : "2022-02-04T23:15:00Z"
  }
}