TensorFlow is an end-to-end open source platform for machine learning. In affected versions TensorFlow and Keras can be tricked to perform arbitrary code execution when deserializing a Keras model from YAML format. The implementation uses yaml.unsafe_load
which can perform arbitrary code execution on the input. Given that YAML format support requires a significant amount of work, we have removed it for now. We have patched the issue in GitHub commit 23d6383eb6c14084a8fc3bdf164043b974818012. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.
The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
Name | Vendor | Start Version | End Version |
---|---|---|---|
Tensorflow | 2.3.0 (including) | 2.3.4 (excluding) | |
Tensorflow | 2.4.0 (including) | 2.4.3 (excluding) | |
Tensorflow | 2.5.0 (including) | 2.5.0 (including) | |
Tensorflow | 2.6.0-rc0 (including) | 2.6.0-rc0 (including) | |
Tensorflow | 2.6.0-rc1 (including) | 2.6.0-rc1 (including) | |
Tensorflow | 2.6.0-rc2 (including) | 2.6.0-rc2 (including) |
It is often convenient to serialize objects for communication or to save them for later use. However, deserialized data or code can often be modified without using the provided accessor functions if it does not use cryptography to protect itself. Furthermore, any cryptography would still be client-side security – which is a dangerous security assumption. Data that is untrusted can not be trusted to be well-formed. When developers place no restrictions on “gadget chains,” or series of instances and method invocations that can self-execute during the deserialization process (i.e., before the object is returned to the caller), it is sometimes possible for attackers to leverage them to perform unauthorized actions, like generating a shell.