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

- Severity: Medium 4.0 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/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.30%, higher than 23% of CVEs (2026-12-01)
- Published: 2021-04-27T20:00:18.000Z
- Modified: 2026-07-08T06:29:36.205Z
- Also known as: GHSA-867q-77cc-98mv
- Weaknesses: CWE-377, CWE-378, CWE-379, CWE-552
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- OpenAPITools openapi-generator: < 5.1.0
- org.openapitools:openapi-generator-maven-plugin (Maven): before 5.1.0
- openapi-generator openapi_generator: before 5.1.0

## Every score

- GitHub_M: CVSS:3.1 4.0 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N`
- GitHub: CVSS:3.1 4.0 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N`
- NVD: CVSS:3.1 3.3 Low `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/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/OpenAPITools/openapi-generator/security/advisories/GHSA-867q-77cc-98mv> (patch, third-party-advisory, web)
- <https://github.com/OpenAPITools/openapi-generator/pull/8795> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-21429> (advisory)
- <https://github.com/OpenAPITools/openapi-generator/blob/06ad7a51eff04393203cfa715e54e1fb59d984fe/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java#L782-L799> (web)

## Sources

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

---

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