CVE-2021-21363: smartbear swagger-codegen
Vulnerability summary
CVE-2021-21363 is a high (CVSS 7.0) vulnerability in smartbear swagger-codegen. EPSS estimates a 0.41% chance of exploitation in the next 30 days, higher than 34.3% of scored vulnerabilities. 1 public exploit is recorded.
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'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.
CVSS metrics
4 scores · 3 sources · 2 versions- CVE.orgCNA5.3MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:NDiffers
- OSV · MavenEcosystem advisory · calculated9.3CriticalCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:HDiffers
EPSS trend
Probability
0.41%
Chance of exploitation in the next 30 days
Percentile
34%
Versus all other CVEs
30-day change
0.00 pp
From 0.41% on 20-09-2026
Known exploited
Compare KEV catalogsNot in any of the 3 tracked catalogs.
Public exploits
1 foundSwagger Codegen
Maturity: poc
Weaknesses
CWE · root cause- 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-379Creation of Temporary File in Directory with Insecure PermissionsThe product creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file.
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-pc22-3g76-gm6jX Refsource CONFIRMWEBExploitThird Party Advisory
- github.com/swagger-api/swagger-codegen/commit/987ea7a30b463cc239580d6ad166c707ae942a89X Refsource MISCWEBPatchThird Party Advisory