CVE-2021-21364: Generated Code Contains Local Information Disclosure Vulnerability
Vulnerability summary
CVE-2021-21364 is a medium (CVSS 5.5) vulnerability in smartbear swagger-codegen. EPSS estimates a 0.29% chance of exploitation in the next 30 days, higher than 22.6% of scored vulnerabilities.
Not severe (CVSS 5.3, local access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Timeline
- 11-03-2021PublishedVulnerability first disclosed.
- 03-08-2024Last modifiedVulnerability information updated.
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.
CVSS metrics
4 scores · 3 sources · 2 versions- CVE.orgCNA5.3MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:N/A:NDiffers
- OSV · MavenEcosystem advisory · calculated6.2MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:NDiffers
EPSS trend
Probability
0.29%
Chance of exploitation in the next 30 days
Percentile
23%
Versus all other CVEs
30-day change
No change 0.00 pp
From 0.28% on 04-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root cause- CWE-200Exposure of Sensitive Information to an Unauthorized ActorThe product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
- CWE-378Creation of Temporary File With Insecure PermissionsOpening temporary files without appropriate measures or controls can leave the file, its contents and any function that it impacts vulnerable to attack.
- CWE-732Incorrect Permission Assignment for Critical ResourceThe product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.
Affected systems
Known conditions: local access, low-privilege account, user interaction (CVSS vector). Other conditions: not stated in public data.
Io.swagger1 product
- swagger-codegen< 2.4.19
Smartbear1 product
- swagger-codegen< 2.4.19
Swagger-api1 product
- swagger-codegen< 2.4.19
3 vendors · 3 products
References
3 links- github.com/swagger-api/swagger-codegen/security/advisories/GHSA-hpv8-9rq5-hq7wX Refsource CONFIRMWEBMitigationThird Party Advisory
- github.com/swagger-api/swagger-codegen/commit/35adbd552d5f99b3ff1e0e59da228becc85190f2X Refsource MISCWEBPatchThird Party Advisory