Generated Code Contains Local Information Disclosure Vulnerability
Key facts
- Attack vector
- Local
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Information disclosure
- Confidentiality · integrity · availability
- High · None · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-200.
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 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.
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-hpv8-9rq5-hq7w |
- 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-hpv8-9rq5-hq7w
Remediation
- Fix · CNA swagger-codegen (swagger-api) Fixed in 2.4.19
- Fix · GHSA-hpv8-9rq5-hq7w io.swagger:swagger-codegen (Maven) Fixed in 2.4.19 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2021-21364
- 2026-10-03 Alias added: GHSA-hpv8-9rq5-hq7w
References
More SMARTBEAR Swagger-codegen vulnerabilities
- TI-2021-04462 Generator Web Application: Local Privilege Escalation Vulnerability via System Temp Directory CVSS 3.1HIGH 7.0
Sources
- CVE-2021-21364 · CVE Program
- CVE-2021-21364 · NVD
- FIRST EPSS
- GHSA-hpv8-9rq5-hq7w · GitHub Advisory Database · CC BY 4.0
- CVE-2021-21364 · 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