SFTP Root Escape in goshs Affected by Prefix-Based Path Validation
CVE-2026-40876
8.7HIGH
What is CVE-2026-40876?
The goshs application, a SimpleHTTPServer developed in Go, is susceptible to a significant vulnerability wherein authenticated SFTP users can access and manipulate files beyond their designated SFTP root. This peril arises due to an inadequate prefix-based path validation mechanism, whereby the sanitization function fails to enforce a proper directory boundary check. Consequently, users can exploit this flaw to gain unauthorized access to adjacent file paths, potentially compromising sensitive data and disrupting server integrity. The issue has been rectified in version 2.0.0-beta.6.
Affected Version(s)
goshs < 2.0.0-beta.6
