9.4critical
goshs route not protected, allows command execution
- Severity
- 9.4critical CVSS:3.0 by GitHub_M
- Exploit likelihood
- 0.77% (higher than 56% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-rwj2-w85g-5cmmGO-2025-3672
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| patrickhener goshs | >= 0.3.4, < 1.0.5 | CVE List |
| github.com/patrickhener/goshs (Go) | from 0.3.4 before 1.0.5 | GitHub Advisory Database, Go Vulnerability Database |
All scores
| GitHub_M | 9.4critical CVSS:3.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L |
| GitHub | 9.4critical CVSS:3.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.
Go Vulnerability Database
goshs route not protected, allows command execution in github.com/patrickhener/goshs
NVD (es)
goshs es un SimpleHTTPServer escrito en Go. A partir de la versión 0.3.4 y anteriores a la 1.0.5, ejecutar goshs sin argumentos permite que cualquiera pueda ejecutar comandos en el servidor. La función `dispatchReadPump` no verifica la opción `-c` de la CLI, lo que permite que cualquiera ejecute cualquier comando mediante websockets. La versión 1.0.5 corrige este problema.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-46816 changed 2025-05-06 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-rwj2-w85g-5cmm changed 2025-05-15 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2025-3672 changed 2026-03-03 | CC-BY-4.0 |
| NVD | CVE-2025-46816 changed 2026-06-17 | Public domain |