// For flags

CVE-2021-29591

Stack overflow due to looping TFLite subgraph

Severity Score

7.8
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

1
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

TensorFlow is an end-to-end open source platform for machine learning. TFlite graphs must not have loops between nodes. However, this condition was not checked and an attacker could craft models that would result in infinite loop during evaluation. In certain cases, the infinite loop would be replaced by stack overflow due to too many recursive calls. For example, the `While` implementation(https://github.com/tensorflow/tensorflow/blob/106d8f4fb89335a2c52d7c895b7a7485465ca8d9/tensorflow/lite/kernels/while.cc) could be tricked into a scneario where both the body and the loop subgraphs are the same. Evaluating one of the subgraphs means calling the `Eval` function for the other and this quickly exhaust all stack space. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range. Please consult our security guide(https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) for more information regarding the security model and how to contact us with issues and questions.

TensorFlow es una plataforma de código abierto de extremo a extremo para el aprendizaje automático. Los gráficos TFlite no deben tener bucles entre nodos. Sin embargo, esta condición no fue comprobada y un atacante podría diseñar modelos que darían como resultado un bucle infinito durante la evaluación. En determinados casos, el bucle infinito sería reemplazado por un desbordamiento de la pila debido a demasiadas llamadas recursivas. Por ejemplo, la implementación "While" (https://github.com/tensorflow/tensorflow/blob/106d8f4fb89335a2c52d7c895b7a7485465ca8d9/tensorflow/lite/kernels/ while.cc) podría engañarse en un argunto donde tanto el cuerpo como los subgrafos de bucle son lo mismo. Evaluar uno de los subgrafos significa llamar a la función "Eval" para el otro y esto agota rápidamente todo el espacio de la pila. La corrección será incluida en TensorFlow versión 2.5.0. También seleccionaremos este commit en TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 y TensorFlow 2.1.4, ya que también están afectados y aún se encuentran en el rango compatible. Consulte nuestra guía de seguridad (https://github.com/tensorflow/tensorflow/blob/master/SECURITY.md) para obtener más información sobre el modelo de seguridad y cómo contactarnos con problemas y preguntas

*Credits: N/A
CVSS Scores
Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
High
Attack Vector
Local
Attack Complexity
Low
Authentication
None
Confidentiality
Partial
Integrity
Partial
Availability
Partial
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2021-03-30 CVE Reserved
  • 2021-05-14 CVE Published
  • 2023-08-06 EPSS Updated
  • 2024-08-03 CVE Updated
  • 2024-08-03 First Exploit
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
CWE
  • CWE-674: Uncontrolled Recursion
  • CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Google
Search vendor "Google"
Tensorflow
Search vendor "Google" for product "Tensorflow"
< 2.1.4
Search vendor "Google" for product "Tensorflow" and version " < 2.1.4"
-
Affected
Google
Search vendor "Google"
Tensorflow
Search vendor "Google" for product "Tensorflow"
>= 2.2.0 < 2.2.3
Search vendor "Google" for product "Tensorflow" and version " >= 2.2.0 < 2.2.3"
-
Affected
Google
Search vendor "Google"
Tensorflow
Search vendor "Google" for product "Tensorflow"
>= 2.3.0 < 2.3.3
Search vendor "Google" for product "Tensorflow" and version " >= 2.3.0 < 2.3.3"
-
Affected
Google
Search vendor "Google"
Tensorflow
Search vendor "Google" for product "Tensorflow"
>= 2.4.0 < 2.4.2
Search vendor "Google" for product "Tensorflow" and version " >= 2.4.0 < 2.4.2"
-
Affected