{"id":"CVE-2021-21430","published":"2021-05-10T19:25:12Z","modified":"2024-08-03T18:09:16Z","title":"Creation of Temporary File in Directory with Insecure Permissions in auto-generated Java, Scala code","vendor":"OpenAPITools","product":"openapi-generator","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.2,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00404,"percentile":0.26174,"provenance":"source"},"cwes":[{"id":"CWE-269","name":"Improper Privilege Management"}],"references":[{"url":"https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-cqxr-xf2w-943w","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/OpenAPITools/openapi-generator/pull/8791","tags":["x_refsource_MISC"]},{"url":"https://github.com/OpenAPITools/openapi-generator/pull/8787","tags":["x_refsource_MISC"]}],"priority":{"score":9.6,"factors":[{"name":"EPSS percentile","points":5.23},{"name":"CVSS severity","points":4.34}]},"vendorSlug":"openapitools","affectedVersions":[{"vendor":"OpenAPITools","product":"openapi-generator","versions":["< 5.1.0"]}],"affected":[{"ecosystem":"Maven","package":"org.openapitools:openapi-generator","vulnerableRanges":["<5.1.0"],"patched":["5.1.0"],"from":["GHSA-cqxr-xf2w-943w"],"provenance":"source"}],"summary":{"text":"The flaw is in the auto-generated Java and Scala client code produced by OpenAPI Generator from OpenAPITools, specifically in the java (jersey2 and okhttp-gson default library) and scala-finch generators, where binary upload and download handling uses File.createTempFile and so creates temporary files with insecure permissions. An attacker with local access to the system, requiring no privileges or user interaction, could read the sensitive binary data that applications leave in these temporary files, with a confidentiality impact.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:56:21Z"},"euvd":{"id":"EUVD-2021-1049","exploited":false,"provenance":"source"}}