{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2021-21430","id":"CVE-2021-21430","title":"Creation of Temporary File in Directory with Insecure Permissions in auto-generated Java, Scala code","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 bina","descriptionLong":"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.","published":"2021-05-10T19:25:12.000Z","updated":"2026-10-20T10:55:20.220674974Z","reserved":"2020-12-22T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","rating":"medium","source":"GitHub_M"},"metrics":[{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","rating":"medium","source":"GitHub_M"},{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","rating":"medium","source":"github.com"},{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","rating":"medium","source":"NVD"},{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","rating":"medium","source":"OSV"},{"version":"3.1","score":6.2,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","rating":"medium","source":"GitHub"},{"version":"2.0","score":2.1,"vector":"AV:L/AC:L/Au:N/C:P/I:N/A:N","rating":"low","source":"NVD"}],"rating":"medium","products":["OpenAPITools openapi-generator"],"affectedProducts":[{"vendor":"OpenAPITools","product":"openapi-generator","defaultStatus":null,"versions":[{"status":"affected","version":"< 5.1.0"}],"platforms":[]}],"packages":[{"ecosystem":"Maven","name":"org.openapitools:openapi-generator","purl":"pkg:maven/org.openapitools/openapi-generator","ranges":["<5.1.0"],"fixed":["5.1.0"],"advisory":"GHSA-cqxr-xf2w-943w"}],"cwes":["CWE-269","CWE-668","CWE-377","CWE-378","CWE-379"],"aliases":["GHSA-cqxr-xf2w-943w"],"references":[{"url":"https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-cqxr-xf2w-943w","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Third Party Advisory","evidence","web"]},{"url":"https://github.com/OpenAPITools/openapi-generator/pull/8791","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/OpenAPITools/openapi-generator/pull/8787","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21430","tags":["advisory"]},{"url":"https://github.com/OpenAPITools/openapi-generator/pull/9348","tags":["web"]},{"url":"https://github.com/OpenAPITools/openapi-generator","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.00404,"epssPercentile":0.35381,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2021-21430","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21430","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2021-21430","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-cqxr-xf2w-943w","ok":true,"note":"GHSA-cqxr-xf2w-943w"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2021-21430","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}