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.
* 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();
```
- GHSA-hpv8-9rq5-hq7w -
github.com/advisories/GHSA-hpv8-9rq5-hq7w
CVEs related to QID 982892
| Advisory ID | Software | Component | Link |
|---|---|---|---|
| GHSA-hpv8-9rq5-hq7w | io.swagger:swagger-codegen |
|