Creation of temporary file in directory with insecure permissions in swagger-codegen - CVE-2021-21363

 

Creation of temporary file in directory with insecure permissions in swagger-codegen - CVE-2021-21363

Published: March 9, 2021 / Updated: November 9, 2026


Vulnerability identifier: #VU162737
CSH Severity: Low
CVSS v4: 8.5 [CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N]
CVE-ID: CVE-2021-21363
CWE-ID: CWE-379
Exploitation vector: Local access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows an unprivileged local attacker to escalate privileges through generated code that is later executed by a higher-privileged user.

The vulnerability exists due to a race condition when the swagger-codegen Generator web application replaces a temporary file with an output directory in the shared system temporary directory on Unix-like systems. An unprivileged local attacker can win this race to own the output directory and modify generated code before its execution.


Affected software

swagger-codegen

How to mitigate CVE-2021-21363

Install security update from vendor's website.

swagger-codegen - update to 2.4.19

External References

Related Security Bulletins