goshs route not protected, allows command execution in github.com/patrickhener/goshs
goshs route not protected, allows command execution in github.com/patrickhener/goshs
02 / AFFECTED SOFTWARE
Affected packages
14 explicit affected versions
03 / CONNECTIONS
Connected vulnerabilities
04 / EVIDENCE
Source records
goshs is a SimpleHTTPServer written in Go. Starting in version 0.3.4 and prior to version 1.0.5, running goshs without arguments makes it possible for anyone to execute commands on the server. The function `dispatchReadPump` does not checks the option cli `-c`, thus allowing anyone to execute arbitrary command through the use of websockets. Version 1.0.5 fixes the issue.
goshs route not protected, allows command execution in github.com/patrickhener/goshs
### 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: ```bash 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.
05 / REFERENCES
Further evidence
- https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/46xxx/CVE-2025-46816.json
- https://github.com/patrickhener/goshs/commit/160220974576afe5111485b8d12fd36058984cfa
- https://github.com/patrickhener/goshs/security/advisories/GHSA-rwj2-w85g-5cmm
- https://nvd.nist.gov/vuln/detail/CVE-2025-46816
- https://github.com/patrickhener/goshs