
Cloud Vulnerability DB
A community-led vulnerabilities database
The vulnerability (CVE-2021-21363) is a local privilege escalation vulnerability discovered in the Swagger Generator Web Application. The issue was disclosed on March 9, 2021, affecting versions prior to 2.4.19 of the swagger-codegen Maven package. The vulnerability stems from insecure handling of temporary directories in the system's shared temporary directory (GitHub Advisory).
The vulnerability exists due to a race condition between the call to delete and mkdirs functions in the temporary directory creation process. The vulnerable code uses File.createTempFile followed by delete and mkdir operations, which creates a window of opportunity for exploitation. The CVSS v3.1 score is 9.4 (Critical) with the vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H, indicating local attack vector, low complexity, no privileges required, and high impact on confidentiality, integrity, and availability (GitHub Advisory).
The vulnerability allows a collocated user to observe the process of creating a temporary sub-directory in the shared temporary directory and race to complete the creation before the application. This enables attackers to control the contents of the outputFolder, potentially leading to execution of attacker-controlled code (GitHub Advisory).
The vulnerability is exploitable locally on Unix-like systems where the system's temporary directory is shared between all users. It requires no special privileges or user interaction to exploit, making it relatively straightforward for a local attacker to leverage (GitHub Advisory).
The vulnerability was patched in version 2.4.19 of swagger-codegen. The fix involves switching to the Files API for creating temporary directories, which eliminates the race condition and properly sets file permissions. Users should upgrade to version 2.4.19 or later to address this vulnerability (GitHub Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."