CVE-2021-21364: smartbear swagger-codegen
Vulnerability summary
CVE-2021-21364 is a medium (CVSS 5.5) vulnerability in smartbear swagger-codegen. EPSS estimates a 0.28% chance of exploitation in the next 30 days, higher than 19.5% of scored vulnerabilities.
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.28%
Chance of exploitation in the next 30 days
Percentile
20%
Versus all other CVEs
30-day change
0.00 pp
From 0.28% on 20-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
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
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