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

- Severity: Critical 9.3 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`
- 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.35%, higher than 30% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-05-10T18:50:12.000Z
- Modified: 2026-07-08T06:27:42.053Z
- Also known as: GHSA-23x4-m842-fmwf
- Weaknesses: CWE-269, CWE-377, CWE-378, CWE-379, CWE-668
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

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

## Every score

- GitHub_M: CVSS:3.1 9.3 Critical `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`
- GitHub: CVSS:3.1 9.3 Critical `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.0 High `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 4.4 Medium `AV:L/AC:M/Au:N/C:P/I:P/A:P`

## References

- <https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-23x4-m842-fmwf> (exploit, third-party-advisory, web)
- <https://github.com/OpenAPITools/openapi-generator/pull/8788> (patch, third-party-advisory, web)
- <https://github.com/swagger-api/swagger-codegen/security/advisories/GHSA-pc22-3g76-gm6j> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-21428> (advisory)
- <https://github.com/OpenAPITools/openapi-generator> (package)
- <https://github.com/OpenAPITools/openapi-generator/blob/c6530519975341d7784a252132b2f0854f488901/modules/openapi-generator-online/src/main/java/org/openapitools/codegen/online/service/Generator.java#L184-L187> (web)

## Sources

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

---

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