CVE-2021-21430
MEDIUM 5.5CVSS 3.1Creation of Temporary File in Directory with Insecure Permissions in auto-generated Java, Scala code
OpenAPI Generator allows generation of API client libraries (SDK generation), 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. Auto-generated code (Java, Scala) that deals with uploading or downloading binary data through API endpoints will create insecure temporary files during the process. Affected generators: java (jersey2, okhttp-gson (default library)), scala-finch. The issue has been patched with Files.createTempFile and released in the v5.1.0 stable version.
- Published
- 10 May 2021
- Last modified
- 8 Jul 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-269CWE-377CWE-378CWE-379CWE-668
- Also known as
- GHSA-cqxr-xf2w-943w
- Sources
- NVDJSONOSV GHSA-cqxr-xf2w-943wJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 6.2 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 6.2 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 5.5 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | LOW 2.1 | AV:L/AC:L/Au:N/C:P/I:N/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | openapi-generator | openapi_generatorcpe:2.3:a:openapi-generator:openapi_generator:*:*:*:*:*:*:*:* |
< 5.1.1 | 5.1.1 |
| OSV | Maven | org.openapitools:openapi-generator | < 5.1.0 | 5.1.0 |
References
- https://github.com/OpenAPITools/openapi-generator/pull/8787 · Patch, Third Party Advisory, WEB
- https://github.com/OpenAPITools/openapi-generator/pull/8791 · Patch, Third Party Advisory, WEB
- https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-cqxr-xf2w-943w · Exploit, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-21430 · ADVISORY
- https://github.com/OpenAPITools/openapi-generator/pull/9348 · WEB
- https://github.com/OpenAPITools/openapi-generator · PACKAGE
History
- 25 Nov 2026 20:33 UTC · NVD: first stored (published 10 May 2021)
- 25 Nov 2026 20:13 UTC · OSV: first stored (published 11 May 2021)