Skip to content
Fencer Vulns
medium 6.2

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

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

Weakness
  • CWE-269 Improper Privilege Management
  • CWE-668 Exposure of Resource to Wrong Sphere
  • CWE-377 DEPRECATED: Insecure Temporary File
  • CWE-378 Creation of Temporary File With Insecure Permissions
  • CWE-379 Creation of Temporary File in Directory with Insecure Permissions

References

Sources

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.