Vulnerability in github.com/patrickhener/goshs/v2 (CVE-2026-62325)
Summary
Vulnerability in github.com/patrickhener/goshs/v2 (CVE-2026-62325). Confidential information can be exposed externally. Exploitable via PasswordHandler. Mitigation: upgrade to 2.1.4 or later.
Original description
The description as published by the source.
Summary
Start goshs v2.1.3 with -b 'admin:' -sftp. No -fkf. SFTP accepts connections without password. CVE-2026-40884 blocks the empty-username variant (-b ':pass'). The empty-password variant bypasses that fix.
CVE-2026-40884
CVE-2026-40884 (GHSA-c29w-qq4m-2gcv, Apr 13 2026) reported the empty-username case: -b ':pass' with -sftp. sftpserver.go:85 uses &&:
if s.Username != "" && s.Password != "" {
sshServer.PasswordHandler = func(ctx ssh.Context, password string) bool {
return subtle.ConstantTimeCompare([]byte(ctx.User()), []byte(s.Username)) == 1 && subtle.ConstantTimeCompare([]byte(password), []byte(s.Password)) == 1
}
}
Empty username → Username != "" false → PasswordHandler nil. No -fkf means PublicKeyHandler also nil. gliderlabs/ssh sees all handlers nil and sets NoClientAuth = true. Unauthenticated access.
Patrickhener fixed it with a sanity check at sanity/checks.go:114-118:
if opts.FTP && opts.FTPSFTPMode && strings.HasPrefix(opts.BasicAuth, ":") {
logger.Fatal("When using SFTP with password authentication, the username cannot be empty. ...")
}
HasPrefix(":") catches empty username. It does not catch empty password.
Empty Password Bypass
Same && at sftpserver.go:85. Same nil handler. Different input:
goshs -b 'admin:' -sftp
Username = "admin",Password = ""Username != "" && Password != ""→ false. Password is empty.PasswordHandlernot set. No `-fkf…
Source: GitHub Security Advisories (Global) NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-62325 has been found in github.com/patrickhener/goshs/v2.
Attackers can target a specific entry point like PasswordHandler over the network to misuse the product.
Confidential information can be exposed externally. CVSS score: 9.1/10.
What to do: upgrade github.com/patrickhener/goshs/v2 to 2.1.4 or later.
If unsure, ask your IT team or search "github.com/patrickhener/goshs/v2 CVE-2026-62325" on the vendor's site.
CVE-2026-62325 (github.com/patrickhener/goshs/v2) — CWE-306 / CVSS v3 9.1
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Attack surface: PasswordHandler / PublicKeyHandler
Patched: 2.1.4 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-306) exists in github.com/patrickhener/goshs/v2. Attackers reach the vulnerable code path via PasswordHandler without authentication.
Check the vendor advisory for the affected versions of github.com/patrickhener/goshs/v2. Attack surface: PasswordHandler / PublicKeyHandler.
Severity: Critical (CVSS 9.1/10). Confidential information can be exposed externally.
Update to 2.1.4.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'github.com/patrickhener/goshs/v2' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'github.com/patrickhener/goshs/v2' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
github.com/patrickhener/goshs/v2を grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade github.com/patrickhener/goshs/v2 to 2.1.4ステージング環境で 2.1.4 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- package github.com
- web github.com
- web github.com
- web github.com
- web github.com