github.com/patrickhener/goshs
Affected
- introduced
0.3.4, fixed1.0.5(semver)
Fixed versions
1.0.5
Fix
- Fixed version
1.0.5go get github.com/patrickhener/[email protected]
Advisory
Also known as: CVE-2025-46816, GO-2025-3672
goshs route not protected, allows command execution
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:
echo -e '{"type": "command", "content": "id"}' |./websocat 'ws://192.168.1.11:8000/?ws' -t
Impact
The vulnerability will only impacts goshs server on vulnerable versions.
Critical Basis: The source's own band: CRITICAL
0.3.4, fixed 1.0.5 (semver)1.0.5
1.0.5go get github.com/patrickhener/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0