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

tensorflow Updated 18 Jul 2026

Summary

09/07/2026
Yes i
High
7.8

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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

TensorFlow is an open-source machine learning framework that provides a comprehensive ecosystem for building and deploying machine learning models. It is widely used for various applications, including deep learning and artificial intelligence. The package includes a command-line tool called saved_model_cli, which is used for interacting with TensorFlow models. However, this tool has a vulnerability that allows for code injection, potentially leading to severe security risks.

Vulnerability Detail

The vulnerability in TensorFlow's saved_model_cli tool arises from an incomplete fix for a previous vulnerability (CVE-2021-41228). The tool allows users to execute arbitrary code through the input_exprs argument, which can be exploited to run malicious code. For example, an attacker could use the command 'saved_model_cli run --input_exprs 'x=print("malicious code to run")' --dir ./ --tag_set serve --signature_def serving_default' to execute harmful commands. This vulnerability can lead to unauthorized access and control over the system, including the ability to open a reverse shell.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "tensorflow==2.21.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==2.6.4"
  • >= 2.7.0, < 2.7.2 2.7.2
    pip install --upgrade "tensorflow==2.7.2"
  • >= 2.8.0, < 2.8.1 2.8.1
    pip install --upgrade "tensorflow==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 you do not pass any untrusted input to the tool.

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 advised to update to the latest patched versions to secure their systems and avoid using the vulnerable features until the update is applied.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

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

You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to check your application without needing to sign up.

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

You can update TensorFlow by running the command 'pip install --upgrade tensorflow' in your terminal or command prompt.

Yes, as a temporary measure, avoid using the saved_model_cli tool with the input_exprs argument until you can update to a patched version.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

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