GHSA-5h6h-7rc9-3824 · Severity: high · Ecosystem: go — SFTP root escape via prefix-based path validation in goshs
goshs is a SimpleHTTPServer written in Go. Prior to 2.0.0-beta.6, goshs contains an SFTP root escape caused by prefix-based path validation. An authenticated SFTP user can read from and write to filesystem paths outside the configured SFTP root, which breaks the intended jail boundary and can expose or modify unrelated server files. The SFTP subsystem routes requests through sftpserver/sftpserver.go into DefaultHandler.GetHandler() in sftpserver/handler.go, which forwards file operations into readFile, writeFile, listFile, and cmdFile. All of those sinks rely on sanitizePath() in sftpserver/helper.go. helper.go uses a raw string-prefix comparison, not a directory-boundary check. Because of that, if the configured root is /tmp/goshsroot, then a sibling path such as /tmp/goshsroot_evil/secret.txt incorrectly passes validation since it starts with the same byte prefix. This vulnerability is fixed in 2.0.0-beta.6.
Conclusion & alert: CVE-2026-40876 is rated High Exploit Risk (62.4/100): CVSS High severity, with low exploitation likelihood (EPSS 0.44%). Core evidence: 1 public exploit reference(s) are indexed (Exploit-DB). Mandatory action: Public exploits are available—assess exposure, apply mitigations, and prioritize patching.
Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.
| EDB-ID | Source | Kind | Published | Link |
|---|---|---|---|---|
| — | nvd_ref | exploit_tag | Exploit-DB ↗ |
EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).
| # | Date | Old EPSS score | New EPSS score | Delta (New - Old) |
|---|---|---|---|---|
| 1 | 2026-06-15 | 0.05% | 0.44% | +0.39% |
| 2 | 2026-04-27 | 0.04% | 0.05% | +0.01% |
| 3 | 2026-04-22 | — | 0.04% | — |
Full EPSS history (3 records total)
CVSS metrics for this CVE.
| Base score | Version | Severity | Vector | Exploitability | Impact | Score source |
|---|---|---|---|---|---|---|
| 8.7 | 4.0 | HIGH |
|
— | — | [email protected] |
| 8.8 | 3.1 | HIGH |
|
2.8 | 5.9 | [email protected] |
GHSA-5h6h-7rc9-3824 · Severity: high · Ecosystem: go — SFTP root escape via prefix-based path validation in goshs
| Vendor | Product | Version | Raw CPE |
|---|---|---|---|
| goshs | goshs | < 2.0.0 | cpe:2.3:a:goshs:goshs:*:*:*:*:*:go:*:* |
| goshs | goshs | 2.0.0 | cpe:2.3:a:goshs:goshs:2.0.0:beta1:*:*:*:go:*:* |
| goshs | goshs | 2.0.0 | cpe:2.3:a:goshs:goshs:2.0.0:beta2:*:*:*:go:*:* |
| goshs | goshs | 2.0.0 | cpe:2.3:a:goshs:goshs:2.0.0:beta3:*:*:*:go:*:* |
| goshs | goshs | 2.0.0 | cpe:2.3:a:goshs:goshs:2.0.0:beta4:*:*:*:go:*:* |
| goshs | goshs | 2.0.0 | cpe:2.3:a:goshs:goshs:2.0.0:beta5:*:*:*:go:*:* |
| URL | Tags |
|---|---|
| https://github.com/patrickhener/goshs/security/advisories/GHSA-5h6h-7rc9-3824 | Exploit Vendor Advisory |