{"id":"CVE-2021-21429","aliases":["CVE-2021-21429","GHSA-867q-77cc-98mv"],"related":[],"kind":"vulnerability","state":"published","title":"Creation of Temporary File in Directory with Insecure Permissions in the OpenAPI Generator Maven plugin","summary":"OpenAPI Generator allows generation of API client libraries, 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. OpenAPI Generator maven plug-in creates insecure temporary files during the process. The issue has been patched with `Files.createTempFile` and released in the v5.1.0 stable version.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"OpenAPI Generator allows generation of API client libraries, 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. OpenAPI Generator maven plug-in creates insecure temporary files during the process. The issue has been patched with `Files.createTempFile` and released in the v5.1.0 stable version.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nUsing `File.createTempFile` in JDK will result in creating and using insecure temporary files that can leave application and system data vulnerable to attacks. This vulnerability only impacts unix-like systems where the local system temporary directory is shared between all users. This vulnerability does not impact Windows or modern versions of MacOS.\n\nOpenAPI Generator Maven plug-in creates insecure temporary files during the code generation process. It creates insecure temporary files to store the OpenAPI specification files provided by the users and these temporary files can be read by any users in the system.\n\nThe impact of this vulnerability is information disclosure of the contents of the specification file to other local users.\n\n### Patches\nThe issue has been patched with `Files.createTempFile` and released in the v5.1.0 stable version.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [OpenAPI Generator Github repo](https://github.com/openAPITools/openapi-generator/)\n* Email us at [security@openapitools.org](mailto:security@openapitools.org)","format":"markdown","source":"ghsa"},{"lang":"es","text":"OpenAPI Generator permite la generación de bibliotecas cliente API, stubs de servidor, documentación y configuración de forma automática dada una especificación OpenAPI.&#xa0;El uso de la función \"File.createTempFile\" en JDK dará como resultado la creación y el uso de archivos temporales no seguros que pueden dejar la aplicación y los datos del sistema vulnerables a ataques.&#xa0;El plugin Maven de OpenAPI Generator crea archivos temporales no seguros durante el proceso.&#xa0;El problema ha sido parcheado con \"Files.createTempFile\" y es lanzado en versión estable v5.1.0","source":"nvd"}],"published":"2021-04-27T20:00:18.000Z","modified":"2026-07-08T06:29:36.205Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":4,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":3.3,"rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:L/AC:L/Au:N/C:P/I:N/A:N","score":2.1,"rating":"LOW"}],"cwes":["CWE-377","CWE-378","CWE-379","CWE-552"],"affected":[{"ranges":[{"version":"< 5.1.0","status":"affected"}],"vendor":"OpenAPITools","product":"openapi-generator","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"5.1.0"}],"ecosystem":"Maven","package":"org.openapitools:openapi-generator-maven-plugin","purl":"pkg:maven/org.openapitools/openapi-generator-maven-plugin","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"5.1.0"}],"vendor":"openapi-generator","product":"openapi_generator","cpe":"cpe:2.3:a:openapi-generator:openapi_generator:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-867q-77cc-98mv","tags":["patch","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/OpenAPITools/openapi-generator/pull/8795","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21429","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/OpenAPITools/openapi-generator/blob/06ad7a51eff04393203cfa715e54e1fb59d984fe/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java#L782-L799","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-21429","url":"https://www.cve.org/CVERecord?id=CVE-2021-21429","licence":"CVE Terms of Use","modified":"2024-08-03T18:09:16.096Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-867q-77cc-98mv","url":"https://github.com/advisories/GHSA-867q-77cc-98mv","licence":"CC-BY-4.0","modified":"2026-07-08T06:29:36.205Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-21429","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21429","licence":"Public domain","modified":"2026-06-17T03:35:33.533Z"}],"updatedAt":"2026-11-25T22:58:01.061Z","epss":{"score":0.00296,"percentile":0.23904,"date":"2026-12-01T12:00:22.000Z"}}