Every CVE Search/ Get API key

CVE-2021-37689

Null pointer dereference in TensorFlow Lite MLIR optimizations

7.8 HighFix available

TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can craft a TFLite model that would trigger a null pointer dereference, which would result in a crash and denial of service. This is caused by the MLIR optimization of L2NormalizeReduceAxis operator. The implementation unconditionally dereferences a pointer to an iterator to a vector without checking that the vector has elements. We have patched the issue in GitHub commit d6b57f461b39fd1aa8c1b870f1b974aac3554955. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
Low
Privileges needed
Low
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

0.17%Down 0.6 points since Aug 13, 2021
90%50%10%1%

What each source reports

CVE List Score used 7.8

Null pointer dereference in TensorFlow Lite MLIR optimizations

TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can craft a TFLite model that would trigger a null pointer dereference, which would result in a crash and denial of service. This is caused by the MLIR optimization of L2NormalizeReduceAxis operator. The implementation unconditionally dereferences a pointer to an iterator to a vector without checking that the vector has elements. We have patched the issue in GitHub commit d6b57f461b39fd1aa8c1b870f1b974aac3554955. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

Record
CVE-2021-37689
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-476
Updated
2026-11-02
EUVDEUVD-2021-0415 7.8

TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can craft a TFLite model that would trigger a null pointer dereference, which would result in a crash and denial of service. This is caused by the MLIR optimization of L2NormalizeReduceAxis operator. The implementation unconditionally dereferences a pointer to an iterator to a vector without checking that the vector has elements. We have patched the issue in GitHub commit d6b57f461b39fd1aa8c1b870f1b974aac3554955. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

Record
EUVD-2021-0415
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-03
GitHub AdvisoriesGHSA-wf5p-c75w-w3wh 8.5

Null pointer dereference in TFLite MLIR optimizations

Impact

An attacker can craft a TFLite model that would trigger a null pointer dereference, which would result in a crash and denial of service:

This is caused by the MLIR optimization of L2NormalizeReduceAxis operator. The implementation unconditionally dereferences a pointer to an iterator to a vector without checking that the vector has elements:

bool L2NormalizeReduceAxis(Value sq_op, DenseElementsAttr axis) {
  if (sq_op.getType().cast<ShapedType>().getRank() - 1 ==
          *axis.getValues<int>().begin() ||
      *axis.getValues<int>().begin() == -1) {
      // ...
  }
  // ...
}

Patches

We have patched the issue in GitHub commit d6b57f461b39fd1aa8c1b870f1b974aac3554955.

The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.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.

Attribution

This vulnerability has been reported by Yakun Zhang of Baidu Security.

Record
GHSA-wf5p-c75w-w3wh
CVSS 4.0
8.5 HighCVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-476
Updated
2026-11-02
NVD 7.8

TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can craft a TFLite model that would trigger a null pointer dereference, which would result in a crash and denial of service. This is caused by the MLIR optimization of L2NormalizeReduceAxis operator. The implementation unconditionally dereferences a pointer to an iterator to a vector without checking that the vector has elements. We have patched the issue in GitHub commit d6b57f461b39fd1aa8c1b870f1b974aac3554955. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

Record
CVE-2021-37689
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS 3.1
5.5 MediumCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
CVSS 2.0
2.1 LowAV:L/AC:L/Au:N/C:N/I:N/A:P
Weakness
CWE-476
Updated
2026-11-02
OSV 5.5

TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can craft a TFLite model that would trigger a null pointer dereference, which would result in a crash and denial of service. This is caused by the MLIR optimization of L2NormalizeReduceAxis operator. The implementation unconditionally dereferences a pointer to an iterator to a vector without checking that the vector has elements. We have patched the issue in GitHub commit d6b57f461b39fd1aa8c1b870f1b974aac3554955. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

Record
CVE-2021-37689
CVSS 3.1
5.5 MediumCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVGHSA-wf5p-c75w-w3wh 8.5

Null pointer dereference in TFLite MLIR optimizations

Impact

An attacker can craft a TFLite model that would trigger a null pointer dereference, which would result in a crash and denial of service:

This is caused by the MLIR optimization of L2NormalizeReduceAxis operator. The implementation unconditionally dereferences a pointer to an iterator to a vector without checking that the vector has elements:

bool L2NormalizeReduceAxis(Value sq_op, DenseElementsAttr axis) {
  if (sq_op.getType().cast<ShapedType>().getRank() - 1 ==
          *axis.getValues<int>().begin() ||
      *axis.getValues<int>().begin() == -1) {
      // ...
  }
  // ...
}

Patches

We have patched the issue in GitHub commit d6b57f461b39fd1aa8c1b870f1b974aac3554955.

The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.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.

Attribution

This vulnerability has been reported by Yakun Zhang of Baidu Security.

Record
GHSA-wf5p-c75w-w3wh
CVSS 4.0
8.5 HighCVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-476
Updated
2026-11-02
Show 6 moreShow less
OSVBIT-tensorflow-2021-37689 No score

Null pointer dereference in TensorFlow Lite MLIR optimizations

TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can craft a TFLite model that would trigger a null pointer dereference, which would result in a crash and denial of service. This is caused by the MLIR optimization of L2NormalizeReduceAxis operator. The implementation unconditionally dereferences a pointer to an iterator to a vector without checking that the vector has elements. We have patched the issue in GitHub commit d6b57f461b39fd1aa8c1b870f1b974aac3554955. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

Record
BIT-tensorflow-2021-37689
Updated
2026-11-02
OSVopenSUSE-SU-2022:10014-1 No score

Security update for tensorflow2

This update for tensorflow fixes the following issues:

Update to TF2 2.6.0 which fixes multiple CVEs (boo#1189423).

  • Introduction of bazel6.3 and basel-skylib1.0.3 as build dependencies. The latter has been adapted to all a version in its package name (if %set_ver_suffix is set to 1). This allows multiple versions to exist for one product (not installed). NOTE: basel-skylib1.0.3 does not exist in oS:Factory: basel-skylib in oS:Factory - the base version - is 1.0.3.
Record
openSUSE-SU-2022:10014-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:12116-1 No score

tensorflow-lite-2.9.1-1.1 on GA media

These are all security issues fixed in the tensorflow-lite-2.9.1-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:12116-1
Updated
2026-11-02
OSVPYSEC-2021-311 No score

TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can craft a TFLite model that would trigger a null pointer dereference, which would result in a crash and denial of service. This is caused by the MLIR optimization of L2NormalizeReduceAxis operator. The implementation unconditionally dereferences a pointer to an iterator to a vector without checking that the vector has elements. We have patched the issue in GitHub commit d6b57f461b39fd1aa8c1b870f1b974aac3554955. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

Record
PYSEC-2021-311
Updated
2026-11-02
OSVPYSEC-2021-602 No score

TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can craft a TFLite model that would trigger a null pointer dereference, which would result in a crash and denial of service. This is caused by the MLIR optimization of L2NormalizeReduceAxis operator. The implementation unconditionally dereferences a pointer to an iterator to a vector without checking that the vector has elements. We have patched the issue in GitHub commit d6b57f461b39fd1aa8c1b870f1b974aac3554955. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

Record
PYSEC-2021-602
Updated
2026-11-02
OSVPYSEC-2021-800 No score

TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can craft a TFLite model that would trigger a null pointer dereference, which would result in a crash and denial of service. This is caused by the MLIR optimization of L2NormalizeReduceAxis operator. The implementation unconditionally dereferences a pointer to an iterator to a vector without checking that the vector has elements. We have patched the issue in GitHub commit d6b57f461b39fd1aa8c1b870f1b974aac3554955. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

Record
PYSEC-2021-800
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
tensorflow
PyPI
before 2.3.4
2.3.4
tensorflow
PyPI
2.4.0 up to 2.4.3
2.4.3
tensorflow
PyPI
2.5.0 to 2.5.0
2.5.1
tensorflow-cpu
PyPI
before 2.3.4
2.3.4
tensorflow-cpu
PyPI
2.4.0 up to 2.4.3
2.4.3
tensorflow-cpu
PyPI
2.5.0 to 2.5.0
2.5.1
tensorflow-gpu
PyPI
before 2.3.4
2.3.4
tensorflow-gpu
PyPI
2.4.0 up to 2.4.3
2.4.3
tensorflow-gpu
PyPI
2.5.0 to 2.5.0
2.5.1
tensorflow
Bitnami
2.3.0 up to 2.3.4, 2.4.0 up to 2.4.3, 2.5.0 up to 2.5.1
2.3.42.4.32.5.1
Show 24 moreShow less
Affected packages
PackageAffectedFixed
tensorflow
PyPI
before 2.3.4, plus listed versions
0.12.00.12.11.0.01.0.11.1.0
Show 44 moreShow less
1.10.01.10.11.11.01.12.01.12.21.12.31.13.11.13.21.14.01.15.01.15.21.15.31.15.41.15.51.2.01.2.11.3.01.4.01.4.11.5.01.5.11.6.01.7.01.7.11.8.01.9.02.0.02.0.12.0.22.0.32.0.42.1.02.1.12.1.22.1.32.1.42.2.02.2.12.2.22.2.32.3.02.3.12.3.22.3.3
2.3.4
tensorflow
PyPI
2.4.0 up to 2.4.3, plus listed versions
2.4.12.4.2
2.4.3
tensorflow
PyPI
2.5.0 up to 2.5.1
2.5.1
tensorflow-cpu
PyPI
before 2.3.4, plus listed versions
1.15.02.1.02.1.12.1.22.1.3
Show 9 moreShow less
2.1.42.2.02.2.12.2.22.2.32.3.02.3.12.3.22.3.3
2.3.4
tensorflow-cpu
PyPI
2.4.0 up to 2.4.3, plus listed versions
2.4.12.4.2
2.4.3
tensorflow-cpu
PyPI
2.5.0 up to 2.5.1
2.5.1
tensorflow-gpu
PyPI
before 2.3.4, plus listed versions
0.12.00.12.11.0.01.0.11.1.0
Show 44 moreShow less
1.10.01.10.11.11.01.12.01.12.21.12.31.13.11.13.21.14.01.15.01.15.21.15.31.15.41.15.51.2.01.2.11.3.01.4.01.4.11.5.01.5.11.6.01.7.01.7.11.8.01.9.02.0.02.0.12.0.22.0.32.0.42.1.02.1.12.1.22.1.32.1.42.2.02.2.12.2.22.2.32.3.02.3.12.3.22.3.3
2.3.4
tensorflow-gpu
PyPI
2.4.0 up to 2.4.3, plus listed versions
2.4.12.4.2
2.4.3
tensorflow-gpu
PyPI
2.5.0 up to 2.5.1
2.5.1
tensorflow
PyPI
2.3.0 up to 2.3.4, 2.4.0 up to 2.4.3, plus listed versions
2.3.12.3.22.3.32.4.12.4.2
2.3.42.4.3
tensorflow-cpu
PyPI
2.3.0 up to 2.3.4, 2.4.0 up to 2.4.3, plus listed versions
2.3.12.3.22.3.32.4.12.4.2
2.3.42.4.3
tensorflow-gpu
PyPI
2.3.0 up to 2.3.4, 2.4.0 up to 2.4.3, plus listed versions
2.3.12.3.22.3.32.4.12.4.2
2.3.42.4.3
bazel-skylib1.0.3
SUSE:Package Hub 15 SP3
From an advisory covering 63 CVEs
before 1.0.3-bp153.2.1
1.0.3-bp153.2.1
bazel3.7
SUSE:Package Hub 15 SP3
From an advisory covering 63 CVEs
before 3.7.2-bp153.4.1
3.7.2-bp153.4.1
tensorflow2
SUSE:Package Hub 15 SP3
From an advisory covering 63 CVEs
before 2.6.0-bp153.2.3.1
2.6.0-bp153.2.3.1
tensorflow2-lite
SUSE:Package Hub 15 SP3
From an advisory covering 63 CVEs
before 2.6.0-bp153.2.3.1
2.6.0-bp153.2.3.1
tensorflow2_2_6_0-gnu-hpc
SUSE:Package Hub 15 SP3
From an advisory covering 63 CVEs
before 2.6.0-bp153.2.3.1
2.6.0-bp153.2.3.1
tensorflow2_2_6_0-gnu-openmpi2-hpc
SUSE:Package Hub 15 SP3
From an advisory covering 63 CVEs
before 2.6.0-bp153.2.3.1
2.6.0-bp153.2.3.1
bazel-skylib1.0.3
openSUSE:Leap 15.3
From an advisory covering 63 CVEs
before 1.0.3-bp153.2.1
1.0.3-bp153.2.1
bazel3.7
openSUSE:Leap 15.3
From an advisory covering 63 CVEs
before 3.7.2-bp153.4.1
3.7.2-bp153.4.1
tensorflow2
openSUSE:Leap 15.3
From an advisory covering 63 CVEs
before 2.6.0-bp153.2.3.1
2.6.0-bp153.2.3.1
tensorflow2-lite
openSUSE:Leap 15.3
From an advisory covering 63 CVEs
before 2.6.0-bp153.2.3.1
2.6.0-bp153.2.3.1
tensorflow2_2_6_0-gnu-hpc
openSUSE:Leap 15.3
From an advisory covering 63 CVEs
before 2.6.0-bp153.2.3.1
2.6.0-bp153.2.3.1
tensorflow2_2_6_0-gnu-openmpi2-hpc
openSUSE:Leap 15.3
From an advisory covering 63 CVEs
before 2.6.0-bp153.2.3.1
2.6.0-bp153.2.3.1

History

History
RecordedChangedSources
affected, facts
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-37689 is a high vulnerability (CVSS 7.8) in Google Tensorflow, published August 12, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.17%, the 5th percentile. Fixed in tensorflow 2.3.4.

References

Show 178 moreShow less
MoveEnter Open