CVE-2022-29216: TensorFlow Code Injection Vulnerability
Summary
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
- tensorflow · PyPI
- tensorflow-cpu · PyPI
- tensorflow-gpu · PyPI
- tensorflow · PyPI
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.
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.
No signup required · Results in about 60 seconds
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.42.6.4 -
>= 2.7.0, < 2.7.22.7.2 -
>= 2.8.0, < 2.8.12.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 →
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.
References
Related vulnerabilities
Recent vulnerabilities recorded for tensorflow.