CVE-2021-21364

Generated Code Contains Local Information Disclosure Vulnerability

MEDIUM
5.5
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
MEDIUM5.5
Exploit prediction
EPSS 0.3%

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 temporary directory is shared between all local users. When files/directories are created, the default `umask` settings for the process are respected. As a result, by default, most processes/apis will create files/directories with the permissions `-rw-r--r--` and `drwxr-xr-x` respectively, unless an API that explicitly sets safe file permissions is used. Because this vulnerability impacts generated code, the generated code will remain vulnerable until fixed manually! This vulnerability is fixed in version 2.4.19. Note this is a distinct vulnerability from CVE-2021-21363.

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
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
NONE
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-200CWE-378CWE-732

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