CVE-2021-21430

Creation of Temporary File in Directory with Insecure Permissions in auto-generated Java, Scala code

MEDIUM
5.5
CVSS Score
Published: May 10, 2021 at 07:25 PM UTC
Updated: June 17, 2026 at 03:35 AM UTC
2 products affected across 2 vendorsOpenapi GeneratorGenerator Openapi Generator

Using openapi-generator by OpenAPITools?

Get instant alerts when new vulnerabilities affect openapi-generator - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.4%

Description

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 5.1.1
Affected range stops below 5.1.1, so it looks safe — our inference, not a vendor statement
v < 5.1.0
Affected range stops below 5.1.0, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
NONE
Availability
NONE
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-269CWE-668

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card