CVE-2025-46816: 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 does not checks the option cli , thus allowing anyone to execute arbitrary command through the use of websockets.
Published May 6, 2025
Affected packages
github.com/patrickhener/goshs
- Ecosystem
- Go
- Affected
- >= 0.3.4, <= 1.0.4
- Fixed in
- 1.0.5
- Check
go list -m github.com/patrickhener/goshs
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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' -tImpact
The vulnerability will only impacts goshs server on vulnerable versions.
Credited to Guilhem7.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-64863
goshs --no-delete WebDAV MOVE bypass allows file deletion/overwrite
critical9.1No fixJul 28, 2026CVE-2026-40884
goshs has an empty-username SFTP password authentication bypass
critical9.8No fixApr 14, 2026CVE-2026-40189
goshs has a file-based ACL authorization bypass in goshs state-changing routes
critical9.8No fixApr 10, 2026CVE-2026-35392
goshs: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in goshs PUT Upload
critical9.8Apr 3, 2026CVE-2026-35393
goshs: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in goshs POST multipart upload
critical9.8Apr 3, 2026CVE-2026-35471
goshs: Improper Limitation of a Pathname to a Restricted Directory (Path Traversal)
critical9.8Apr 3, 2026
