Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-21363

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.

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

Source evidence

CVE-2021-21363

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'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.

osv:CVE-2021-21363
Complete source record
{
  "id": "7138eeb6e6b8cd88e1289e9a09c5a6f1b0328a40ba9438a27d2272cb71c3991d",
  "url": "https://osv.dev/vulnerability/CVE-2021-21363",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-21363",
    "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'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.",
    "evidence": "osv:CVE-2021-21363",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2021-21363",
      "aliases": [
        "CVE-2021-21363",
        "GHSA-pc22-3g76-gm6j"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/swagger-api/swagger-codegen",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "ab21af6f6566f603e0ccb3556b0d3158d3740eac"
                },
                {
                  "fixed": "987ea7a30b463cc239580d6ad166c707ae942a89"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:smartbear:swagger-codegen:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "2.4.19"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "987ea7a30b463cc239580d6ad166c707ae942a89"
                      }
                    ],
                    "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-21363.json"
          }
        }
      ],
      "modified": "2026-10-20T10:54:29.506445599Z",
      "provider": "osv",
      "references": [
        "https://github.com/swagger-api/swagger-codegen/commit/987ea7a30b463cc239580d6ad166c707ae942a89",
        "https://github.com/swagger-api/swagger-codegen/security/advisories/GHSA-pc22-3g76-gm6j"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-21363",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 385451,
  "published_at": "2021-03-11T03:15:11.977+00:00"
}