# CVE-2021-21364: Generated Code Contains Local Information Disclosure Vulnerability

- 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:H/I:N/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.28%, higher than 22% of CVEs (2026-12-01)
- Published: 2021-03-11T03:05:16.000Z
- Modified: 2026-07-08T06:28:55.973Z
- Also known as: GHSA-hpv8-9rq5-hq7w
- Weaknesses: CWE-200, CWE-378, CWE-732
- 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 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.

(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:H/I:N/A:N`
- GitHub: CVSS:3.1 6.2 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:2.0 2.1 Low `AV:L/AC:L/Au:N/C:P/I:N/A:N`

## References

- <https://github.com/swagger-api/swagger-codegen/security/advisories/GHSA-hpv8-9rq5-hq7w> (mitigation, third-party-advisory, web)
- <https://github.com/swagger-api/swagger-codegen/commit/35adbd552d5f99b3ff1e0e59da228becc85190f2> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-21364> (advisory)

## Sources

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

---

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