Generator Web Application: Local Privilege Escalation Vulnerability via System Temp Directory
Key facts
- Attack vector
- Local
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- High
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| swagger-api | swagger-codegen | before 2.4.19 | 2.4.19 | Patch available | CNA |
| — | io.swagger:swagger-codegen (Maven) | before 2.4.19 | 2.4.19 | Patch available | GHSA-pc22-3g76-gm6j |
- swagger-codegen Vendorswagger-api Affected before 2.4.19 Fixed in 2.4.19 Patch available CNA
- io.swagger:swagger-codegen (Maven) Vendor— Affected before 2.4.19 Fixed in 2.4.19 Patch available GHSA-pc22-3g76-gm6j
Remediation
- Fix · CNA swagger-codegen (swagger-api) Fixed in 2.4.19
- Fix · GHSA-pc22-3g76-gm6j io.swagger:swagger-codegen (Maven) Fixed in 2.4.19 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2021-21363
- 2026-10-03 Alias added: GHSA-pc22-3g76-gm6j
References
More SMARTBEAR Swagger-codegen vulnerabilities
- TI-2021-04463 Generated Code Contains Local Information Disclosure Vulnerability CVSS 3.1MEDIUM 5.5
Sources
- CVE-2021-21363 · CVE Program
- CVE-2021-21363 · NVD
- FIRST EPSS
- GHSA-pc22-3g76-gm6j · GitHub Advisory Database · CC BY 4.0
- CVE-2021-21363 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences