Register for the AI for Security Summit: Join Figma, Perplexity & Wiz

CVE-2021-21363
Java vulnerability analysis and mitigation

Overview

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).

Technical details

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).

Impact

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).

Exploitability

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).

Mitigation and workarounds

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).

Additional resources


SourceThis report was generated using AI

Related Java vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-53837CRITICAL9.9
  • Java logoJava
  • org.xwiki.rendering:xwiki-rendering-xml
NoYesSep 18, 2026
CVE-2026-77615HIGH8.7
  • JavaScript logoJavaScript
  • paella-core
NoYesSep 17, 2026
CVE-2026-54148HIGH8.1
  • Java logoJava
  • org.http4k:http4k-security-digest
NoYesSep 18, 2026
CVE-2026-85058HIGH7.5
  • Java logoJava
  • io.moquette:moquette-broker
NoYesSep 18, 2026
CVE-2026-54147MEDIUM6.5
  • Java logoJava
  • org.http4k:http4k-security-digest
NoYesSep 18, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management