// For flags

CVE-2021-21363

Generator Web Application: Local Privilege Escalation Vulnerability via System Temp Directory

Severity Score

7.0
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

1
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

swagger-codegen is an open-source project which contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition. In swagger-codegen before version 2.4.19, on Unix like systems, the system's temporary directory is shared between all users on that system. A collocated user can observe the process of creating a temporary sub directory in the shared temporary directory and race to complete the creation of the temporary subdirectory. This vulnerability is local privilege escalation because the contents of the `outputFolder` can be appended to by an attacker. As such, code written to this directory, when executed can be attacker controlled. For more details refer to the referenced GitHub Security Advisory. This vulnerability is fixed in version 2.4.19. Note this is a distinct vulnerability from CVE-2021-21364.

swagger-codegen es un proyecto de código abierto que contiene un motor basado en plantillas para generar documentación, clientes API y stubs de servidor en diferentes idiomas mediante el análisis de su definición de OpenAPI/Swagger. En swagger-codegen versiones anteriores a 2.4.19, en sistemas similares a Unix, el directorio temporal del sistema se comparte entre todos los usuarios de ese sistema. Un usuario ubicado puede observar el proceso de creación de un subdirectorio temporal en el directorio temporal compartido y una corrida para completar la creación del subdirectorio temporal. Esta vulnerabilidad es una escalada de privilegios local porque un atacante puede agregar el contenido de "outputFolder". Como tal, el código escrito en este directorio, cuando se ejecuta, puede ser controlado por el atacante. Para mayor detalles, consulte el GitHub Security Advisory al que se hace referencia. Esta vulnerabilidad es corregido en versión 2.4.19

*Credits: N/A
CVSS Scores
Attack Vector
Local
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Local
Attack Complexity
High
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
None
Integrity
High
Availability
None
Attack Vector
Local
Attack Complexity
Medium
Authentication
None
Confidentiality
Partial
Integrity
Partial
Availability
Partial
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2020-12-22 CVE Reserved
  • 2021-03-11 CVE Published
  • 2023-03-08 EPSS Updated
  • 2024-08-03 CVE Updated
  • 2024-08-03 First Exploit
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
CWE
  • CWE-378: Creation of Temporary File With Insecure Permissions
  • CWE-379: Creation of Temporary File in Directory with Insecure Permissions
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Smartbear
Search vendor "Smartbear"
Swagger-codegen
Search vendor "Smartbear" for product "Swagger-codegen"
< 2.4.19
Search vendor "Smartbear" for product "Swagger-codegen" and version " < 2.4.19"
-
Affected