Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-21364

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-21364
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 11:32 UTC · Revision 1

Source evidence

CVE-2021-21364

core-osv · Original source

Published 11 Mar 2021, 03:15 UTC

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.

osv:CVE-2021-21364
Complete source record
{
  "id": "2aacb63c673d5cd30747e4dcfb0d9fca69624a56c50dacf7324fab9470bb7e1f",
  "url": "https://osv.dev/vulnerability/CVE-2021-21364",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-21364",
    "summary": "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.",
    "evidence": "osv:CVE-2021-21364",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2021-21364",
      "aliases": [
        "CVE-2021-21364",
        "GHSA-hpv8-9rq5-hq7w"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/swagger-api/swagger-codegen",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "ab21af6f6566f603e0ccb3556b0d3158d3740eac"
                },
                {
                  "fixed": "35adbd552d5f99b3ff1e0e59da228becc85190f2"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:smartbear:swagger-codegen:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "2.4.19"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "35adbd552d5f99b3ff1e0e59da228becc85190f2"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v2.4.18",
            "v2.4.17",
            "v2.4.16",
            "v3.0.21",
            "v2.4.15",
            "v2.4.14",
            "v2.4.13",
            "v2.4.12",
            "v2.4.11",
            "v2.4.10",
            "v2.4.9",
            "v2.4.8",
            "v2.4.7",
            "v2.4.6",
            "v2.4.5",
            "v2.4.4",
            "v2.4.3",
            "v2.4.2",
            "v2.4.1",
            "v2.4.0",
            "v2.3.1",
            "v2.3.0",
            "v2.2.3",
            "v2.2.2",
            "v2.2.1",
            "v2.2.0",
            "v2.1.6",
            "v2.1.5",
            "v2.1.4",
            "v2.1.3",
            "v2.1.2",
            "v2.1.0-M2",
            "v2.1.2-M1",
            "v2.1.1-M1",
            "v2.1.0-M1",
            "v2.0.18",
            "2.0.17",
            "swagger-codegen_2.9.1-2.0.1",
            "swagger-codegen_2.9.1-2.0.0",
            "swagger-codegen_2.9.1-1.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21364.json"
          }
        }
      ],
      "modified": "2026-10-20T10:54:29.507851893Z",
      "provider": "osv",
      "references": [
        "https://github.com/swagger-api/swagger-codegen/security/advisories/GHSA-hpv8-9rq5-hq7w",
        "https://github.com/swagger-api/swagger-codegen/commit/35adbd552d5f99b3ff1e0e59da228becc85190f2"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-21364",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 385452,
  "published_at": "2021-03-11T03:15:12.07+00:00"
}