Skip to content

GHSA-pgcq-h79j-2f69 BIT-tensorflow-2021-41206 CVE-2021-41206 PYSEC-2021-843 PYSEC-2021-845 PYSEC-2021-847

Incomplete validation of shapes in multiple TF ops

High PyPI
Severity
0.0 / 10
High · CVSS 4.0
Exploit chance (EPSS)
0.18%
Chance of exploitation in the next 30 days. Higher than 7.59% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-354 Improper Validation of Integrity Check Value
Fix
Available
3 packages have a fixed version

Description

Impact

Several TensorFlow operations are missing validation for the shapes of the tensor arguments involved in the call. Depending on the API, this can result in undefined behavior and segfault or CHECK-fail related crashes but in some scenarios writes and reads from heap populated arrays are also possible.

We have discovered these issues internally via tooling while working on improving/testing GPU op determinism. As such, we don't have reproducers and there will be multiple fixes for these issues.

Patches

We have patched the issue in GitHub commits 68422b215e618df5ad375bcdc6d2052e9fd3080a, 4d74d8a00b07441cba090a02e0dd9ed385145bf4, 579261dcd446385831fe4f7457d802a59685121d, da4aad5946be30e5f049920fa076e1f7ef021261, 4dddb2fd0b01cdd196101afbba6518658a2c9e07, and e7f497570abb6b4ae5af4970620cd880e4c0c904.

These fixes will be included in TensorFlow 2.7.0. We will also cherrypick these commits on TensorFlow 2.6.1, TensorFlow 2.5.2, and TensorFlow 2.4.4, as these are also affected and still in supported range.

For more information

Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.

Affected versions

PyPI

PackageVulnerableFixed in
tensorflow
>= 2.6.0, < 2.6.1
2.6.1
tensorflow
>= 2.5.0, < 2.5.2
2.5.2
tensorflow
< 2.4.4
2.4.4
tensorflow
< 2.4.4
>= 2.5.0, < 2.5.2
>= 2.6.0, < 2.6.1
2.4.4
2.5.2
2.6.1
tensorflow-cpu
>= 2.6.0, < 2.6.1
2.6.1
tensorflow-cpu
>= 2.5.0, < 2.5.2
2.5.2
tensorflow-cpu
< 2.4.4
2.4.4
tensorflow-cpu
< 2.4.4
>= 2.5.0, < 2.5.2
>= 2.6.0, < 2.6.1
2.4.4
2.5.2
2.6.1
tensorflow-gpu
>= 2.6.0, < 2.6.1
2.6.1
tensorflow-gpu
>= 2.5.0, < 2.5.2
2.5.2
tensorflow-gpu
< 2.4.4
2.4.4
tensorflow-gpu
< 2.4.4
>= 2.5.0, < 2.5.2
>= 2.6.0, < 2.6.1
2.4.4
2.5.2
2.6.1

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

tensorflow PyPI → 2.6.1

pip
pip install --upgrade "tensorflow>=2.6.1"
poetry
poetry add "tensorflow>=2.6.1"
uv
uv add "tensorflow>=2.6.1"

tensorflow-cpu PyPI → 2.6.1

pip
pip install --upgrade "tensorflow-cpu>=2.6.1"
poetry
poetry add "tensorflow-cpu>=2.6.1"
uv
uv add "tensorflow-cpu>=2.6.1"

tensorflow-gpu PyPI → 2.6.1

pip
pip install --upgrade "tensorflow-gpu>=2.6.1"
poetry
poetry add "tensorflow-gpu>=2.6.1"
uv
uv add "tensorflow-gpu>=2.6.1"

Severity breakdown

CVSS 4.0 0.0

CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Attack vector
Local
Attack complexity
Low
Attack requirements
Present
Privileges required
Low
User interaction
None
Confidentiality (vulnerable system)
High
Integrity (vulnerable system)
High
Availability (vulnerable system)
High
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None

CVSS 3.1 7.0

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Attack vector
Local
Attack complexity
High
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Weakness

CWE-354: Improper Validation of Integrity Check Value

The product does not validate or incorrectly validates the integrity check values or "checksums" of a message. This may prevent it from detecting if the data has been modified or corrupted in transmission.

How to prevent it
  • Implementation: Ensure that the checksums present in messages are properly checked in accordance with the protocol specification before they are parsed and used.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-gjh7-xx4r-x345
TensorFlow has segfault in array_ops.upper_bound
High Also affects tensorflow
GHSA-fxgc-95xx-grvq
TensorFlow Denial of Service vulnerability
Medium Also affects tensorflow
GHSA-93vr-9q9m-pj8p
TensorFlow vulnerable to Out-of-Bounds Read in DynamicStitch
High Also affects tensorflow
GHSA-qjqc-vqcf-5qvj
TensorFlow vulnerable to seg fault in `tf.raw_ops.Print`
High Also affects tensorflow
GHSA-7jvm-xxmr-v5cw
TensorFlow vulnerable to integer overflow in EditDistance
High Also affects tensorflow
GHSA-64jg-wjww-7c5w
TensorFlow has Null Pointer Error in TensorArrayConcatV2
High Also affects tensorflow
GHSA-6hg6-5c2q-7rcr
TensorFlow has Heap-buffer-overflow in AvgPoolGrad
High Also affects tensorflow
GHSA-558h-mq8x-7q9g
TensorFlow has Null Pointer Error in SparseSparseMaximum
High Also affects tensorflow
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor