CVE-2021-21363
HIGH 7.0CVSS 3.1Generator Web Application: Local Privilege Escalation Vulnerability via System Temp Directory
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.
- Published
- 11 Mar 2021
- Last modified
- 8 Jul 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-378CWE-379
- Also known as
- GHSA-pc22-3g76-gm6j
- Sources
- NVDJSONOSV GHSA-pc22-3g76-gm6jJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 3.1 | CRITICAL 9.3 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 7.0 | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 5.3 | CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 4.4 | AV:L/AC:M/Au:N/C:P/I:P/A:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | smartbear | swagger-codegencpe:2.3:a:smartbear:swagger-codegen:*:*:*:*:*:*:*:* |
< 2.4.19 | 2.4.19 |
| OSV | Maven | io.swagger:swagger-codegen | < 2.4.19 | 2.4.19 |
References
- https://github.com/swagger-api/swagger-codegen/commit/987ea7a30b463cc239580d6ad166c707ae942a89 · Patch, Third Party Advisory, WEB
- https://github.com/swagger-api/swagger-codegen/security/advisories/GHSA-pc22-3g76-gm6j · Exploit, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-21363 · ADVISORY
History
- 25 Nov 2026 20:32 UTC · NVD: first stored (published 11 Mar 2021)
- 25 Nov 2026 20:13 UTC · OSV: first stored (published 11 Mar 2021)