CVE-2022-29216: TensorFlow Code Injection Vulnerability in saved_model_cli

tensorflow-gpu Updated 07 Jul 2026

Summary

06/07/2026
Yes i
High
7.8

CVE-2022-29216: Code injection in saved_model_cli in TensorFlow. Affects tensorflow-gpu 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 machine learning library widely used for various applications, including deep learning and neural networks. It provides tools for building and training models, and one of its components, saved_model_cli, is used for serving and managing saved models. However, this tool has a vulnerability that allows for code injection, which could lead to severe security risks.

Vulnerability Detail

The vulnerability in TensorFlow's saved_model_cli tool stems from an incomplete fix for a previous issue (CVE-2021-41228). It allows users to execute arbitrary code through the input_exprs argument, which can lead to a code injection attack. For example, an attacker could run a command to open a reverse shell, compromising the system's security. The vulnerability arises from the use of the eval function in the code, which can execute arbitrary expressions, making it a significant security concern.

How To Fix

Latest published version: 2.12.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-gpu==2.12.0"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

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

  • < 2.6.4 2.6.4
    pip install --upgrade "tensorflow-gpu==2.6.4"
  • >= 2.7.0, < 2.7.2 2.7.2
    pip install --upgrade "tensorflow-gpu==2.7.2"
  • >= 2.8.0, < 2.8.1 2.8.1
    pip install --upgrade "tensorflow-gpu==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

As a temporary workaround, avoid using the saved_model_cli tool with the input_exprs argument until you can update to a patched version. If you must use it, ensure that the input expressions are safe and do not contain any executable code.

Conclusion

The CVE-2022-29216 vulnerability in TensorFlow's saved_model_cli tool poses a significant risk due to its potential for code injection. Users are strongly advised to update to the latest patched versions to secure their applications. Additionally, temporary workarounds should be employed until an update can be performed.

See every vulnerability recorded for tensorflow-gpu →

Share this vulnerability

FAQ

CVE-2022-29216 is a code injection vulnerability found in TensorFlow's saved_model_cli tool, allowing attackers to execute arbitrary code.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.

The vulnerability can lead to unauthorized code execution, potentially allowing attackers to gain control over the system or access sensitive data.

If you cannot update TensorFlow right away, avoid using the vulnerable features of saved_model_cli and ensure that any input expressions are safe.

The CVSS score of this vulnerability is 7.8, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow-gpu.

How To Fix

Latest published version: 2.12.0 as of 22 Oct 2026

pip install --upgrade "tensorflow-gpu==2.12.0"

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

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

  • < 2.6.4 2.6.4
    pip install --upgrade "tensorflow-gpu==2.6.4"
  • >= 2.7.0, < 2.7.2 2.7.2
    pip install --upgrade "tensorflow-gpu==2.7.2"
  • >= 2.8.0, < 2.8.1 2.8.1
    pip install --upgrade "tensorflow-gpu==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