CVE-2021-21428: Insecure Temporary File Creation in OpenAPI-Generator Online Generator
Summary
CVE-2021-21428: Impact On Unix like systems, the system's temporary directory is shared between all users on that system. Affects org.openapitools:openapi-generator-online versions < 5.1.0. Fixed in 5.1.0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The OpenAPI-Generator is an open-source tool that generates API client libraries, server stubs, and documentation from an OpenAPI Specification. The OpenAPI-Generator Online Generator is a web-based service that allows users to generate code and files based on their OpenAPI Specification. The vulnerable package in question is 'org.openapitools:openapi-generator-online' version 0 to 5.0.1. This package is written in Java and is part of the Maven ecosystem.
Vulnerability Detail
The OpenAPI-Generator Online Generator creates insecure temporary folders with 'File.createTempFile' during the code generation process. This vulnerability allows a collocated user on Unix-like systems to observe the creation of a temporary subdirectory and race to complete the creation of the same directory. By doing so, the attacker gains control over the directory and can read and append files within it. This local privilege escalation vulnerability can lead to arbitrary code execution if the attacker places malicious code in the compromised directory.
How To Fix
Latest published version: 7.26.0 as of 23 Oct 2026
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
5.1.0
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is recommended to apply the patch by updating to version 5.1.0 or higher.
Conclusion
The OpenAPI-Generator Online Generator has a vulnerability that allows local privilege escalation and potential arbitrary code execution. Users of the 'org.openapitools:openapi-generator-online' package should update to version 5.1.0 or higher to fix this vulnerability. It is recommended to regularly check for and apply security patches to ensure the safety of your software.
See every vulnerability recorded for org.openapitools:openapi-generator-online →
FAQ
This vulnerability allows an attacker to gain control over the temporary folders used by the OpenAPI-Generator Online Generator. They can read and append files within these folders, potentially leading to arbitrary code execution.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply provide your pom.xml file and the Vulert Playground will analyze it for open-source vulnerabilities, including this one.
There is no known public exploit for this vulnerability at the time of writing. However, it is important to apply the patch as soon as possible to mitigate the risk.
No, this vulnerability requires local access to the system where the OpenAPI-Generator Online Generator is running. It cannot be exploited remotely over a network.
This vulnerability specifically affects the 'org.openapitools:openapi-generator-online' package. Other packages in the OpenAPI-Generator project may have similar vulnerabilities, but they would be tracked and reported separately.
References
Related vulnerabilities
Recent vulnerabilities recorded for org.openapitools:openapi-generator-online.