GHSA-mw6j-hh29-h379: Tensorflow `CHECK` Failure Vulnerability
MODERATEGHSA-mw6j-hh29-h379 is a MODERATE `check` failure vulnerability (CWE-190: Integer Overflow or Wraparound) affecting Tensorflow libraries in the PyPI ecosystem. The issue involves `check` failure in depthwise ops via overflows. Remediation is available by upgrading affected packages to version 2.6.4, 2.7.2, 2.8.1.
GHSA-mw6j-hh29-h379 at a Glance
How to Fix GHSA-mw6j-hh29-h379
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.6.4
pip install tensorflow>=2.7.2
pip install tensorflow>=2.8.1
pip install tensorflow-cpu>=2.6.4
pip install tensorflow-cpu>=2.7.2
pip install tensorflow-cpu>=2.8.1
pip install tensorflow-gpu>=2.6.4
pip install tensorflow-gpu>=2.7.2
pip install tensorflow-gpu>=2.8.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-mw6j-hh29-h379, 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.6.4), 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-mw6j-hh29-h379 Affected Tensorflow Versions
9 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
tensorflow
|
PyPI |
< 2.6.4
|
2.6.4
|
|
tensorflow
|
PyPI |
≥ 2.7.0
< 2.7.2
|
2.7.2
|
|
tensorflow
|
PyPI |
≥ 2.8.0
< 2.8.1
|
2.8.1
|
|
tensorflow-cpu
|
PyPI |
< 2.6.4
|
2.6.4
|
|
tensorflow-cpu
|
PyPI |
≥ 2.7.0
< 2.7.2
|
2.7.2
|
|
tensorflow-cpu
|
PyPI |
≥ 2.8.0
< 2.8.1
|
2.8.1
|
|
tensorflow-gpu
|
PyPI |
< 2.6.4
|
2.6.4
|
|
tensorflow-gpu
|
PyPI |
≥ 2.7.0
< 2.7.2
|
2.7.2
|
|
tensorflow-gpu
|
PyPI |
≥ 2.8.0
< 2.8.1
|
2.8.1
|
References
Frequently Asked Questions
What is GHSA-mw6j-hh29-h379?
Which Tensorflow versions are affected?
What version fixes GHSA-mw6j-hh29-h379?
Is tensorflow affected?
Is tensorflow-cpu affected?
What CWE is associated with GHSA-mw6j-hh29-h379?
How can I check PyPI dependencies for GHSA-mw6j-hh29-h379?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mw6j-hh29-h379",
"modified" : "2022-05-25T19:33:50Z",
"published" : "2022-05-25T19:33:50Z",
"aliases" : [ ],
"summary" : "`CHECK` failure in depthwise ops via overflows",
"details" : "### Impact\nThe implementation of depthwise ops in TensorFlow is vulnerable to a denial of service via `CHECK`-failure (assertion failure) caused by overflowing the number of elements in a tensor:\n\n```python\nimport tensorflow as tf\n\ninput = tf.constant(1, shape=[1, 4, 4, 3], dtype=tf.float32)\nfilter_sizes = tf.constant(1879048192, shape=[13], dtype=tf.int32)\nout_backprop = tf.constant(1, shape=[1, 4, 4, 3], dtype=tf.float32)\ntf.raw_ops.DepthwiseConv2dNativeBackpropFilter(\n input=input, filter_sizes=filter_sizes, out_backprop=out_backprop, strides=[1, 1, 1, 1], padding=\"SAME\")\n```\n \nThis is another 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 [3796cc4fcd93ae55812a457abc96dcd55fbb854b](https://github.com/tensorflow/tensorflow/commit/3796cc4fcd93ae55812a457abc96dcd55fbb854b).\n\nThe fix will be included in TensorFlow 2.9.0. We will also cherrypick this commit on TensorFlow 2.8.1, TensorFlow 2.7.2, and TensorFlow 2.6.4, 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.\n\n### Attribution\nThis vulnerability has been reported by Neophytos Christou from Secure Systems Lab at Brown University.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.6.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.7.0"
}, {
"fixed" : "2.7.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.8.0"
}, {
"fixed" : "2.8.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow-cpu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.6.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow-cpu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.7.0"
}, {
"fixed" : "2.7.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow-cpu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.8.0"
}, {
"fixed" : "2.8.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow-gpu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.6.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow-gpu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.7.0"
}, {
"fixed" : "2.7.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "tensorflow-gpu"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.8.0"
}, {
"fixed" : "2.8.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/tensorflow/tensorflow/security/advisories/GHSA-mw6j-hh29-h379"
}, {
"type" : "WEB",
"url" : "https://github.com/tensorflow/tensorflow/commit/3796cc4fcd93ae55812a457abc96dcd55fbb854b"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/tensorflow/tensorflow"
}, {
"type" : "WEB",
"url" : "https://github.com/tensorflow/tensorflow/blob/master/tensorflow/security/advisory/tfsa-2021-198.md"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-190" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-05-25T19:33:50Z",
"nvd_published_at" : null
}
}