Advisory Database
  • Advisories
  • Dependency Scanning
  1. maven
  2. ›
  3. io.swagger/swagger-codegen
  4. ›
  5. CVE-2021-21363

CVE-2021-21363: Creation of Temporary File in Directory with Insecure Permissions

March 11, 2021 (updated March 22, 2021)

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.

References

  • github.com/advisories/GHSA-pc22-3g76-gm6j
  • github.com/swagger-api/swagger-codegen/commit/987ea7a30b463cc239580d6ad166c707ae942a89
  • github.com/swagger-api/swagger-codegen/security/advisories/GHSA-pc22-3g76-gm6j
  • nvd.nist.gov/vuln/detail/CVE-2021-21363

Code Behaviors & Features

Detect and mitigate CVE-2021-21363 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 2.4.19

Fixed versions

  • 2.4.19

Solution

Upgrade to version 2.4.19 or above.

Impact 7 HIGH

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-378: Creation of Temporary File With Insecure Permissions
  • CWE-379: Creation of Temporary File in Directory with Insecure Permissions
  • CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Source file

maven/io.swagger/swagger-codegen/CVE-2021-21363.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:50 +0000.