{"schemaVersion":3,"id":"CVE-2021-21364","aliases":["GHSA-hpv8-9rq5-hq7w"],"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 temporary directory is shared between all local users. When files/directories are created, the default `umask` settings for the process are respected. As a result, by default, most processes/apis will create files/directories with the permissions `-rw-r--r--` and `drwxr-xr-x` respectively, unless an API that explicitly sets safe file permissions is used. Because this vulnerability impacts generated code, the generated code will remain vulnerable until fixed manually! This vulnerability is fixed in version 2.4.19. Note this is a distinct vulnerability from CVE-2021-21363.","dates":{"published":"2021-03-11T03:05:16.000Z","modified":"2024-08-03T18:09:15.938Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":5.5,"severity":"medium","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","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:H/I:N/A:N","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Maven","score":6.2,"severity":"medium","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","exploitability":6.4,"impact":6,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":5.5,"severity":"medium","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","exploitability":null,"impact":null,"computed":false},{"version":"2.0","versionLabel":"v2.0","source":"NVD","score":2.1,"severity":"low","vector":"AV:L/AC:L/Au:N/C:P/I:N/A:N","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00282,"percentile":0.195,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.00282},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00282,"percentile":0.195}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00282,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00282,"percentile":0.195}]},"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":[],"exploitCount":0,"weaknesses":[{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor","description":"The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.","type":"weakness","status":"Draft","abstraction":"Class","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/200.html"},{"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-732","name":"Incorrect Permission Assignment for Critical Resource","description":"The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.","type":"weakness","status":"Draft","abstraction":"Class","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/732.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-hpv8-9rq5-hq7w","label":"github.com/swagger-api/swagger-codegen/security/advisories/GHSA-hpv8-9rq5-hq7w","hostname":"github.com","tags":["X Refsource CONFIRM","WEB","Mitigation","Third Party Advisory"]},{"url":"https://github.com/swagger-api/swagger-codegen/commit/35adbd552d5f99b3ff1e0e59da228becc85190f2","label":"github.com/swagger-api/swagger-codegen/commit/35adbd552d5f99b3ff1e0e59da228becc85190f2","hostname":"github.com","tags":["X Refsource MISC","WEB","Patch","Third Party Advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21364","label":"nvd.nist.gov/vuln/detail/CVE-2021-21364","hostname":"nvd.nist.gov","tags":["Advisory"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2021-03-11T03:05:16.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-08-03T18:09:15.938Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":22,"level":"low","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T23:47:47.691Z","stale":false,"partial":false}}