{"id":"CVE-2021-21363","published":"2021-03-11T03:05:23Z","modified":"2024-08-03T18:09:16Z","title":"Generator Web Application: Local Privilege Escalation Vulnerability via System Temp Directory","vendor":"swagger-api","product":"swagger-codegen","tier":"tail","description":{"text":"swagger-codegen is an open-source project which contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition. In swagger-codegen before version 2.4.19, on Unix like systems, the system's temporary directory is shared between all users on that system. A collocated user can observe the process of creating a temporary sub directory in the shared temporary directory and race to complete the creation of the temporary subdirectory. This vulnerability is local privilege escalation because the contents of the `outputFolder` can be appended to by an attacker. As such, code written to this directory, when executed can be attacker controlled. For more details refer to the referenced GitHub Security Advisory. This vulnerability is fixed in version 2.4.19. Note this is a distinct vulnerability from CVE-2021-21364.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00414,"percentile":0.27367,"provenance":"source"},"cwes":[{"id":"CWE-379","name":"Creation of Temporary File in Directory with Insecure Permissions"},{"id":"CWE-378","name":"Creation of Temporary File With Insecure Permissions"}],"references":[{"url":"https://github.com/swagger-api/swagger-codegen/security/advisories/GHSA-pc22-3g76-gm6j","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/swagger-api/swagger-codegen/commit/987ea7a30b463cc239580d6ad166c707ae942a89","tags":["x_refsource_MISC"]}],"priority":{"score":9.2,"factors":[{"name":"EPSS percentile","points":5.47},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"swagger-api","affectedVersions":[{"vendor":"swagger-api","product":"swagger-codegen","versions":["< 2.4.19"]}],"affected":[{"ecosystem":"Maven","package":"io.swagger:swagger-codegen","vulnerableRanges":["<2.4.19"],"patched":["2.4.19"],"from":["GHSA-pc22-3g76-gm6j"],"provenance":"source"}],"summary":{"text":"In swagger-codegen before version 2.4.19 on Unix-like systems, the code generator creates a temporary subdirectory inside the system temporary directory, which is shared between all users on the machine. A local user who is collocated on the same system can observe that creation and race to complete it first, so that files written into the resulting outputFolder can be attacker-controlled, which can lead to attacker-controlled code being executed; exploitation requires local access, a race condition, and user interaction in the form of the victim running the generator.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:00:10Z"},"euvd":{"id":"EUVD-2021-0688","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-swagger-api-swagger-codegen-cve-2021-21363","children":[{"from":"CVE-2021-21363","to":"CVE-2021-21428","relation":"related","confidence":"high","kind":"lineage","evidence":[{"kind":"osv-related","provenance":"source","id":"GHSA-23x4-m842-fmwf","via":"reference","url":"https://github.com/swagger-api/swagger-codegen/security/advisories/GHSA-pc22-3g76-gm6j"}]}]}}