CVE-2021-41228
Python vulnerability analysis and mitigation

Overview

TensorFlow's saved_model_cli tool was found to contain a code injection vulnerability (CVE-2021-41228) in versions prior to 2.7.0. The vulnerability was discovered in September 2021 and publicly disclosed in November 2021. The issue affects TensorFlow versions from 2.4.0 up to (excluding) 2.4.4, 2.5.0 up to (excluding) 2.5.2, 2.6.0 up to (excluding) 2.6.1, and 2.7.0-rc0/rc1 (NVD, GitHub Advisory).

Technical details

The vulnerability exists in the saved_model_cli tool's preprocess_input_exprs_arg_string function, which uses an unsafe eval() call on user-supplied strings from the --input_examples argument. The function processes input strings and directly evaluates them using Python's eval() function without proper sanitization, allowing arbitrary code execution. The issue has been assigned a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (NVD, JFrog).

Impact

An attacker who can control the contents of the --input_examples argument can execute arbitrary Python code on the platform where the CLI tool runs. However, the impact is considered less severe since the tool requires manual execution. The vulnerability could potentially lead to unauthorized code execution, system compromise, and data breaches (GitHub Advisory).

Mitigation and workarounds

The issue was fixed in TensorFlow 2.7.0 by replacing the unsafe eval() call with json.loads() and adding a safe flag that defaults to True. The fix was also backported to versions 2.6.1, 2.5.2, and 2.4.4. Users are strongly advised to upgrade to these patched versions. The fix restricts the --input_examples inputs to Python literals to prevent code injection (GitHub Commit).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-66645HIGH7.5
  • PythonPython
  • nicegui
NoYesDec 09, 2025
CVE-2025-66470MEDIUM6.1
  • PythonPython
  • nicegui
NoYesDec 09, 2025
CVE-2025-66469MEDIUM6.1
  • PythonPython
  • nicegui
NoYesDec 09, 2025
CVE-2025-67502MEDIUM5.4
  • PythonPython
  • taguette
NoYesDec 09, 2025
CVE-2025-67485MEDIUM5.3
  • PythonPython
  • mad-proxy
NoNoDec 09, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management