OpenAPITools / OpenAPITools/openapi-generator
[BUG][JAVA] Coverity giving High risk severity issue in ApiClient code - Filesystem path, filename, or URI manipulation
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
Coverity code analysis tool is raising the security issue of type Filesystem path, filename, or URI manipulation in the ApiClient code.
- Calling "deserialize". This call uses "response" for sensitive computation. (The virtual call resolves to "client.api.ApiClient.deserialize(jakarta.ws.rs.core.Response, jakarta.ws.rs.core.GenericType)".)
Impacted code
public <T> ApiResponse<T> invokeAPI(...) {
[...]
if (statusCode == Status.NO_CONTENT.getStatusCode()) {
return new ApiResponse<T>(statusCode, responseHeaders);
} else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) {
if (returnType == null) {
return new ApiResponse<T>(statusCode, responseHeaders);
} else {
return new ApiResponse<T>(statusCode, responseHeaders, deserialize(response, returnType));
}
} else {
[...]
}
The issue is raised on this specific line :
return new ApiResponse<T>(statusCode, responseHeaders, deserialize(response, returnType));
Is there any way to fix or to avoid this issue ?
openapi-generator version
openapi-generator-maven-plugin, version 6.6.0
Generation Details
Java generator, using jersey3 as library
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Java jersey3 ApiClient.invokeAPI path around the deserialize(response, returnType) call and review how Coverity interprets that flow. Reproduce the finding with openapi-generator-maven-plugin version 6.6.0, then validate that the generated client still behaves correctly and the reported filesystem path, filename, or URI manipulation issue is resolved or appropriately addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100