You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When accessing the getLocalCoverResult Interface with special request, unauthorized attackers can execute any command on the target system.
Code Analyzing
The function getEnvLocalCoverResult in file CodeCovController.java handles the request for getLocalCoverResult. And it calls codeCovService.getLocalCoverResult.
In the function pullExecFile, it has command combinations with paramters localHostRequestParam.getNowPath()、localHostRequestParam.getAddress()、localHostRequestParam.getPort().
Proof of Concept
Attacker can inject command in the parameter address. The request with file creation and results are as following.
The following conditions should be satisfied:
the parameter basePath and nowPath need to be the local paths where the Git repository is stored.
the parameter baseVersion and nowVersion need to be two version numbers from the repository, with new Java files added between these versions.
With above conditions satisfied, although the response message may return an error saying 'Failed to pull the executable file,' the command still executes successfully.
When accessing the getLocalCoverResult Interface with special request, unauthorized attackers can execute any command on the target system.
Code Analyzing
localHostRequestParam.getNowPath()
、localHostRequestParam.getAddress()
、localHostRequestParam.getPort()
.Proof of Concept
Attacker can inject command in the parameter address. The request with file creation and results are as following.
The following conditions should be satisfied:
With above conditions satisfied, although the response message may return an error saying 'Failed to pull the executable file,' the command still executes successfully.
The payload with reverse shell and execution results are as following.
The text was updated successfully, but these errors were encountered: