QID 982892

QID 982892: Java (maven) Security Update for io.swagger:swagger-codegen (GHSA-hpv8-9rq5-hq7w)

Security update has been released for io.swagger:swagger-codegen to fix the vulnerability.

Note: The preceding description block is extracted directly from the security advisory. Using automation, we have attempted to clean and format it as much as possible without introducing additional issues.

**This vulnerability impacts generated code.** If this code was generated as a one-off occasion, not as a part of an automated CI/CD process, this code will remain vulnerable until fixed manually!

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.

  • CVSS V3 rated as Medium - 5.5 severity.
  • CVSS V2 rated as Low - 2.1 severity.
  • Solution
    Fix has been applied to the master branch with:

    * https://github.com/swagger-api/swagger-codegen/commit/35adbd552d5f99b3ff1e0e59da228becc85190f2

    included in release: 2.4.19Workaround:
    Users can remediate the vulnerability in non patched version by manually (or programmatically e.g. in CI) updating the generated source code to use `java.nio.files.Files` temporary file creation instead of `java.io.File`, e.g. by changing

    ```java

    if (tempFolderPath == null)
    return File.createTempFile(prefix, suffix);
    else
    return File.createTempFile(prefix, suffix, new File(tempFolderPath));

    ```

    to

    ```java

    if (tempFolderPath == null)
    return Files.createTempFile(prefix, suffix).toFile();
    else
    return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile();

    ```

    or generally changing:

    ```java

    File.createTempFile(prefix, suffix);

    ```

    to

    ```java

    Files.createTempFile(prefix, suffix).toFile();

    ```
    Vendor References

    CVEs related to QID 982892

    Software Advisories
    Advisory ID Software Component Link
    GHSA-hpv8-9rq5-hq7w io.swagger:swagger-codegen URL Logo github.com/advisories/GHSA-hpv8-9rq5-hq7w

    © CVE.report 2026

    Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

    CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

    Free CVE JSON API cve.report/api

    CVE.report and Source URL Uptime Status status.cve.report