GHSA-wcv5-vrvr-3rx2: Tensorflow Integer Overflow Or Wraparound Vulnerability
MODERATEGHSA-wcv5-vrvr-3rx2 is a MODERATE (CVSS 5.5) integer overflow or wraparound vulnerability (CWE-190: Integer Overflow or Wraparound) affecting Tensorflow libraries in the PyPI ecosystem. The issue involves integer overflow or wraparound in tensorflow. Remediation is available by upgrading affected packages to version 2.5.3, 2.6.3, 2.7.1.
GHSA-wcv5-vrvr-3rx2 at a Glance
Security Impact
CVSS: 5.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).
How to Fix GHSA-wcv5-vrvr-3rx2
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.
pip install tensorflow>=2.5.3
pip install tensorflow>=2.6.3
pip install tensorflow>=2.7.1
pip install tensorflow-cpu>=2.5.3
pip install tensorflow-cpu>=2.6.3
pip install tensorflow-cpu>=2.7.1
pip install tensorflow-gpu>=2.5.3
pip install tensorflow-gpu>=2.6.3
pip install tensorflow-gpu>=2.7.1
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 GHSA-wcv5-vrvr-3rx2, 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.5.3), 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-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. 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
GHSA-wcv5-vrvr-3rx2 Affected Tensorflow Versions
9 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
tensorflow
|
PyPI |
< 2.5.3
|
2.5.3
|
|
tensorflow
|
PyPI |
≥ 2.6.0
< 2.6.3
|
2.6.3
|
|
tensorflow
|
PyPI |
≥ 2.7.0
< 2.7.1
All 1 versions
2.7.0
|
2.7.1
|
|
tensorflow-cpu
|
PyPI |
< 2.5.3
|
2.5.3
|
|
tensorflow-cpu
|
PyPI |
≥ 2.6.0
< 2.6.3
|
2.6.3
|
|
tensorflow-cpu
|
PyPI |
≥ 2.7.0
< 2.7.1
All 1 versions
2.7.0
|
2.7.1
|
|
tensorflow-gpu
|
PyPI |
< 2.5.3
|
2.5.3
|
|
tensorflow-gpu
|
PyPI |
≥ 2.6.0
< 2.6.3
|
2.6.3
|
|
tensorflow-gpu
|
PyPI |
≥ 2.7.0
< 2.7.1
All 1 versions
2.7.0
|
2.7.1
|
References
Frequently Asked Questions
What is GHSA-wcv5-vrvr-3rx2?
Which Tensorflow versions are affected?
What version fixes GHSA-wcv5-vrvr-3rx2?
Is tensorflow affected?
Is tensorflow-cpu affected?
What is the CVSS score of GHSA-wcv5-vrvr-3rx2?
What CWE is associated with GHSA-wcv5-vrvr-3rx2?
How can I check PyPI dependencies for GHSA-wcv5-vrvr-3rx2?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wcv5-vrvr-3rx2",
"modified" : "2022-02-03T23:13:13Z",
"published" : "2022-02-09T23:34:06Z",
"aliases" : [ ],
"summary" : "Integer Overflow or Wraparound in TensorFlow",
"details" : "### Impact\nThe Grappler component of TensorFlow is vulnerable to a denial of service via `CHECK`-failure (assertion failure) in [constant folding](https://github.com/tensorflow/tensorflow/blob/a1320ec1eac186da1d03f033109191f715b2b130/tensorflow/core/grappler/optimizers/constant_folding.cc#L963-L1035):\n\n```cc\n for (const auto& output_prop : output_props) {\n const PartialTensorShape output_shape(output_prop.shape());\n // ...\n }\n```\n \nThe `output_prop` tensor has a shape that is controlled by user input and this can result in triggering one of the `CHECK`s in the `PartialTensorShape` constructor. This is an instance of [TFSA-2021-198](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/security/advisory/tfsa-2021-198.md) (CVE-2021-41197).\n\n### Patches\nWe have patched the issue in GitHub commit [be7b286d40bc68cb0b56f702186cc4837d508058](https://github.com/tensorflow/tensorflow/commit/be7b286d40bc68cb0b56f702186cc4837d508058).\n\nThe 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.\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:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.5.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.6.0"
}, {
"fixed" : "2.6.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.7.0"
}, {
"fixed" : "2.7.1"
} ]
} ],
"versions" : [ "2.7.0" ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow-cpu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.5.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow-cpu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.6.0"
}, {
"fixed" : "2.6.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow-cpu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.7.0"
}, {
"fixed" : "2.7.1"
} ]
} ],
"versions" : [ "2.7.0" ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow-gpu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.5.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow-gpu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.6.0"
}, {
"fixed" : "2.6.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow-gpu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.7.0"
}, {
"fixed" : "2.7.1"
} ]
} ],
"versions" : [ "2.7.0" ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/tensorflow/tensorflow/security/advisories/GHSA-prcg-wp5q-rv7p"
}, {
"type" : "WEB",
"url" : "https://github.com/tensorflow/tensorflow/security/advisories/GHSA-wcv5-vrvr-3rx2"
}, {
"type" : "WEB",
"url" : "https://github.com/tensorflow/tensorflow/commit/be7b286d40bc68cb0b56f702186cc4837d508058"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/tensorflow/tensorflow"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-190" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-02-03T23:13:13Z",
"nvd_published_at" : null
}
}