{"schemaVersion":3,"id":"CVE-2021-21363","aliases":["GHSA-pc22-3g76-gm6j"],"status":"published","duplicateOf":null,"title":null,"description":"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.","dates":{"published":"2021-03-11T03:05:23.000Z","modified":"2024-08-03T18:09:16.080Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":7,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":5.3,"severity":"medium","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:N/I:H/A:N","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Maven","score":9.3,"severity":"critical","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","exploitability":6.4,"impact":10,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":7,"severity":"high","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false},{"version":"2.0","versionLabel":"v2.0","source":"NVD","score":4.4,"severity":"medium","vector":"AV:L/AC:M/Au:N/C:P/I:P/A:P","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00414,"percentile":0.34374,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.00414},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00414,"percentile":0.34374}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00414,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00414,"percentile":0.34374}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[{"id":"GITHUB_SWAGGER-API_SWAGGER-CODEGEN","name":"Swagger Codegen","source":"github","url":"https://github.com/swagger-api/swagger-codegen/security/advisories/GHSA-pc22-3g76-gm6j","maturity":"poc","reliabilityScore":0.3,"verified":false,"type":null,"platforms":[],"requiresAuth":null,"exploitdb":null,"metasploit":null}],"exploitCount":1,"weaknesses":[{"id":"CWE-378","name":"Creation of Temporary File With Insecure Permissions","description":"Opening temporary files without appropriate measures or controls can leave the file, its contents and any function that it impacts vulnerable to attack.","type":"weakness","status":"Draft","abstraction":"Base","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/378.html"},{"id":"CWE-379","name":"Creation of Temporary File in Directory with Insecure Permissions","description":"The product creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file.","type":"weakness","status":"Incomplete","abstraction":"Base","likelihoodOfExploit":"Low","url":"https://cwe.mitre.org/data/definitions/379.html"}],"affected":[{"vendor":"io.swagger","product":"swagger-codegen","name":"io.swagger:swagger-codegen","label":"swagger-codegen","ecosystem":"Maven","cpePart":null,"purl":"pkg:maven/io.swagger/swagger-codegen","purlType":"maven","versions":[{"text":"< 2.4.19","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.4.19","eol":null,"hubHref":null},{"vendor":"smartbear","product":"swagger-codegen","name":"swagger-codegen","label":"swagger-codegen","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 2.4.19","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.4.19","eol":null,"hubHref":"/vendor/smartbear/swagger-codegen"},{"vendor":"swagger-api","product":"swagger-codegen","name":"swagger-codegen","label":"swagger-codegen","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 2.4.19","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.4.19","eol":null,"hubHref":"/vendor/swagger-api/swagger-codegen"}],"affectedCount":3,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/swagger-api/swagger-codegen/security/advisories/GHSA-pc22-3g76-gm6j","label":"github.com/swagger-api/swagger-codegen/security/advisories/GHSA-pc22-3g76-gm6j","hostname":"github.com","tags":["X Refsource CONFIRM","WEB","Exploit","Third Party Advisory"]},{"url":"https://github.com/swagger-api/swagger-codegen/commit/987ea7a30b463cc239580d6ad166c707ae942a89","label":"github.com/swagger-api/swagger-codegen/commit/987ea7a30b463cc239580d6ad166c707ae942a89","hostname":"github.com","tags":["X Refsource MISC","WEB","Patch","Third Party Advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21363","label":"nvd.nist.gov/vuln/detail/CVE-2021-21363","hostname":"nvd.nist.gov","tags":["Advisory"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2021-03-11T03:05:23.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-08-03T18:09:16.080Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":38,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-21T04:07:35.135Z","stale":false,"partial":false}}