CVE-2022-29216: TensorFlow Code Injection Vulnerability

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2022-29216: Code injection in saved_model_cli in TensorFlow. Affects tensorflow across 3 version ranges.

< 2.6.4 >= 2.7.0, < 2.7.2 >= 2.8.0, < 2.8.1

Fixed in 2.6.4, 2.7.2 or 2.8.1, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2022-29216 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

TensorFlow is an open source platform for machine learning. It provides a comprehensive ecosystem for developing and deploying machine learning models. TensorFlow's saved_model_cli tool is used for inspecting and executing TensorFlow SavedModels. It allows users to interact with SavedModels through a command-line interface. However, prior to versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4, the saved_model_cli tool is vulnerable to a code injection.

Vulnerability Detail

The code injection vulnerability in TensorFlow's saved_model_cli tool allows an attacker to execute arbitrary code, potentially leading to remote code execution. The vulnerability arises from the tool's support for numpy expressions as arguments. The maintainers had initially allowed numpy expressions for compatibility reasons, but this introduced a security risk. Although the impact of this vulnerability is limited since the tool is manually run, it is still considered a high severity issue. The maintainers have addressed the vulnerability by removing the safe=False argument, ensuring that all parsing is done without calling eval.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.6.4 2.6.4
  • >= 2.7.0, < 2.7.2 2.7.2
  • >= 2.8.0, < 2.8.1 2.8.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability.

Conclusion

The code injection vulnerability in TensorFlow's saved_model_cli tool has been addressed in the patched versions of TensorFlow. Users are advised to upgrade to versions 2.9.0, 2.8.1, 2.7.2, or 2.6.4 to mitigate the risk of remote code execution. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open source platform for machine learning that provides a comprehensive ecosystem for developing and deploying machine learning models.

The saved_model_cli tool is used for inspecting and executing TensorFlow SavedModels through a command-line interface.

Code injection is a security vulnerability that allows an attacker to insert and execute arbitrary code within an application or system.

The impact of this vulnerability is limited since the saved_model_cli tool is manually run. However, if exploited, it could lead to remote code execution.

To fix this vulnerability, you should upgrade to the patched versions of TensorFlow, specifically versions 2.9.0, 2.8.1, 2.7.2, or 2.6.4.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.6.4 2.6.4
  • >= 2.7.0, < 2.7.2 2.7.2
  • >= 2.8.0, < 2.8.1 2.8.1

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback