goshs SFTP authentication bypass via empty password (incomplete fix of CVE-2026-40884)
goshs-labs goshs
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/patrickhener/goshs/v2 Go |
|
|
| goshs.de/goshs/v2 Go |
|
|
| goshs.de/goshs Go |
goshs-labs goshs
| Product | Affected | Fixed in |
|---|---|---|
| github.com/patrickhener/goshs/v2 Go |
|
|
| goshs.de/goshs/v2 Go |
|
|
| goshs.de/goshs Go |
all versions| No fix yet |
goshs is a feature-rich single-binary file server for red teamers and developers. From 2.1.3 until 2.1.4, the sftpserver/sftpserver.go password handler used Username != "" && Password != "", so running goshs with -b 'admin:' -sftp and no -fkf left both SFTP authentication handlers unset and allowed unauthenticated file access. This issue is fixed in version 2.1.4.
From the CVE record · GitHub_M
The SFTP password handler can leave authentication disabled when goshs is run with `-b 'admin:' -sftp` and without `-fkf`. A remote attacker can then access files without authenticating; no user interaction is required.
Check deployments using `github.com/patrickhener/goshs/v2` or `goshs.de/goshs/v2` versions >=2.1.3 and <2.1.4, or any version of `goshs.de/goshs`.