# CVE-2021-21363: Generator Web Application: Local Privilege Escalation Vulnerability via System Temp Directory

- Severity: Medium 5.3 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.41%, higher than 37% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-03-11T03:05:23.000Z
- Modified: 2026-07-08T06:00:38.991Z
- Also known as: GHSA-pc22-3g76-gm6j
- Weaknesses: CWE-378, CWE-379
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- swagger-api swagger-codegen: < 2.4.19
- io.swagger:swagger-codegen (Maven): before 2.4.19
- smartbear swagger-codegen: before 2.4.19

## Every score

- GitHub_M: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:N`
- GitHub: CVSS:3.1 9.3 Low `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.0 High `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 4.4 Medium `AV:L/AC:M/Au:N/C:P/I:P/A:P`

## References

- <https://github.com/swagger-api/swagger-codegen/security/advisories/GHSA-pc22-3g76-gm6j> (exploit, third-party-advisory, web)
- <https://github.com/swagger-api/swagger-codegen/commit/987ea7a30b463cc239580d6ad166c707ae942a89> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-21363> (advisory)

## Sources

- CVE List: [CVE-2021-21363](https://www.cve.org/CVERecord?id=CVE-2021-21363), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-pc22-3g76-gm6j](https://github.com/advisories/GHSA-pc22-3g76-gm6j), CC-BY-4.0, modified 2026-07-08
- NVD: [CVE-2021-21363](https://nvd.nist.gov/vuln/detail/CVE-2021-21363), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-21363 · Whole record: https://cve.day/CVE-2021-21363.json · Rebuilt by cve.day 2026-11-25T22:58:00.234Z
