CVE-2021-21430 json
Creation of Temporary File in Directory with Insecure Permissions in auto-generated Java, Scala code
published 2021-05-10 5 y ago modified 2026-07-08 4 mo ago also GHSA-cqxr-xf2w-943w , EUVD-2021-1049
- cvss
- 6.2
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.4%
- EPSS 0.4% chance of exploitation in 30 days, percentile 34%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- maven org.openapitools:openapi-generator 5.1.0
- openapi-generator openapi_generator 5.1.1
- openapi-generator Arch Linux 5.1.1-1
arch linux advisories AVG-1939
- github.com/OpenAPITools/openapi-generator#8791 pull request
- github.com/OpenAPITools/openapi-generator#8787 pull request
- github.com/OpenAPITools/openapi-generator#9348 pull request
Exploit prediction
0.40% chance of exploitation in the next 30 days, higher than 34% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-cqxr-xf2w-943w referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 6.2 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 3.1 | 5.5 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N |
| NVD | 2.0 | 2.1 | AV:L/AC:L/Au:N/C:P/I:N/A:N |
| GitHub | 3.1 | 6.2 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| maven | org.openapitools:openapi-generator | <5.1.0 |
5.1.0 |
Affected products
- OpenAPITools openapi-generator
Classification
References
-
github.com
/OpenAPITools/openapi-generator/pull/8791
web, patch, third-party-advisory
-
github.com
/OpenAPITools/openapi-generator/pull/8787
web, patch, third-party-advisory
-
github.com
/OpenAPITools/openapi-generator/pull/9348
web
-
github.com
/OpenAPITools/openapi-generator/security/advisories/GHSA-cqxr-xf2w-943w
web, exploit, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-21430
advisory
-
github.com
/OpenAPITools/openapi-generator
package
Sources
- CVE List CVE-2021-21430
- GitHub Advisory GHSA-cqxr-xf2w-943w
- NVD CVE-2021-21430
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.