goshs route not protected, allows command execution
Package
Affected versions
>= 0.3.4, <= 1.0.4
Patched versions
1.0.5
Description
Published to the GitHub Advisory Database
May 6, 2025
Reviewed
May 6, 2025
Published by the National Vulnerability Database
May 6, 2025
Last updated
May 6, 2025
Summary
It seems that when running goshs without arguments it is possible for anyone to execute commands on the server. This was tested on version 1.0.4 of goshs. The command function was introduced in version 0.3.4.
Details
It seems that the function
dispatchReadPump
does not checks the option cli-c
, thus allowing anyone to execute arbitrary command through the use of websockets.PoC
Used websocat for the POC:
Impact
The vulnerability will only impacts goshs server on vulnerable versions.
References