CVE-2025-46816
JSON

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 packageVersionsReported by
patrickhener goshs>= 0.3.4, < 1.0.5CVE List
github.com/patrickhener/goshs (Go)from 0.3.4 before 1.0.5GitHub Advisory Database, Go Vulnerability Database

All scores

GitHub_M9.4critical CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
GitHub9.4critical CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L

Classification

CWE-77CWE-284

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.

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

SourceRecordLicence
CVE ListCVE-2025-46816 changed 2025-05-06CVE Terms of Use
GitHub Advisory DatabaseGHSA-rwj2-w85g-5cmm changed 2025-05-15CC-BY-4.0
Go Vulnerability DatabaseGO-2025-3672 changed 2026-03-03CC-BY-4.0
NVDCVE-2025-46816 changed 2026-06-17Public domain