CVE-2021-21363

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

HIGH
7
CVSS Score
Published: March 11, 2021 at 03:05 AM UTC
Updated: June 17, 2026 at 03:35 AM UTC
2 products affected across 2 vendorsSwagger CodegenSwagger Codegen

Using swagger-codegen by swagger-api?

Get instant alerts when new vulnerabilities affect swagger-codegen - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7
Exploit prediction
EPSS 0.4%

Description

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 2.4.19
Affected range stops below 2.4.19, so it looks safe — our inference, not a vendor statement
v < 2.4.19
Affected range stops below 2.4.19, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

CVSS

Attack Vector
LOCAL
Complexity
HIGH
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-378CWE-379

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card