Skip to content

Null-dereference in Tensorflow

Moderate severity GitHub Reviewed Published Feb 2, 2022 in tensorflow/tensorflow • Updated Feb 3, 2023

Package

pip tensorflow (pip)

Affected versions

< 2.5.3
>= 2.6.0, < 2.6.3
= 2.7.0

Patched versions

2.5.3
2.6.3
2.7.1
pip tensorflow-cpu (pip)
< 2.5.3
>= 2.6.0, < 2.6.3
= 2.7.0
2.5.3
2.6.3
2.7.1
pip tensorflow-gpu (pip)
< 2.5.3
>= 2.6.0, < 2.6.3
= 2.7.0
2.5.3
2.6.3
2.7.1

Description

Impact

The implementation of GetInitOp is vulnerable to a crash caused by dereferencing a null pointer:

const auto& init_op_sig_it =
    meta_graph_def.signature_def().find(kSavedModelInitOpSignatureKey);
if (init_op_sig_it != sig_def_map.end()) {
  *init_op_name = init_op_sig_it->second.outputs()
                      .find(kSavedModelInitOpSignatureKey)
                      ->second.name();
  return Status::OK();
}

Here, we have a nested map and we assume that if the first .find succeeds then so would be the search in the internal map. However, the maps are built based on the SavedModel protobuf format and a malicious user can alter that on disk before loading to cause the second .find to return nullptr.

Patches

We have patched the issue in GitHub commit 4f38b1ac8e42727e18a2f0bde06d3bee8e77b250.

The 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.

For more information

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

References

@mihaimaruseac mihaimaruseac published to tensorflow/tensorflow Feb 2, 2022
Reviewed Feb 4, 2022
Published by the National Vulnerability Database Feb 4, 2022
Published to the GitHub Advisory Database Feb 10, 2022
Last updated Feb 3, 2023

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

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

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

EPSS score

0.155%
(52nd percentile)

Weaknesses

CVE ID

CVE-2022-23577

GHSA ID

GHSA-8cxv-76p7-jxwr
Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.