CyberIntel ⬡ News
★ Saved ◆ Cyber Reads
← Back ⬡ Vulnerabilities & CVEs Apr 22, 2026

CVE-2026-40876 | patrickhener goshs up to 2.0.0-beta.5 sftpserver/sftpserver.go DefaultHandler.GetHandler path traversal (GHSA-5h6h-7rc9-3824)

VulDB Archived Apr 22, 2026 ✓ Full text saved

A vulnerability classified as critical was found in patrickhener goshs up to 2.0.0-beta.5 . Affected by this issue is the function DefaultHandler.GetHandler of the file sftpserver/sftpserver.go . Such manipulation leads to path traversal. This vulnerability is listed as CVE-2026-40876 . The attack may be performed from remote. There is no available exploit. Upgrading the affected component is advised.

Full text archived locally
✦ AI Summary · Claude Sonnet


    VDB-358569 · CVE-2026-40876 · GHSA-5H6H-7RC9-3824 PATRICKHENER GOSHS UP TO 2.0.0-BETA.5 SFTPSERVER/SFTPSERVER.GO DEFAULTHANDLER.GETHANDLER PATH TRAVERSAL HISTORYDIFFRELATEJSONXMLCTI CVSS Meta Temp Score Current Exploit Price (≈) CTI Interest Score 6.0 $0-$5k 2.04+ Summaryinfo A vulnerability, which was classified as critical, has been found in patrickhener goshs up to 2.0.0-beta.5. This affects the function DefaultHandler.GetHandler of the file sftpserver/sftpserver.go. Performing a manipulation results in path traversal. This vulnerability is cataloged as CVE-2026-40876. It is possible to initiate the attack remotely. There is no exploit available. It is advisable to upgrade the affected component. Detailsinfo A vulnerability classified as critical has been found in patrickhener goshs up to 2.0.0-beta.5. This affects the function DefaultHandler.GetHandler of the file sftpserver/sftpserver.go. The manipulation with an unknown input leads to a path traversal vulnerability. CWE is classifying the issue as CWE-22. The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. This is going to have an impact on confidentiality, integrity, and availability. The summary by CVE is: 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. The advisory is shared at github.com. This vulnerability is uniquely identified as CVE-2026-40876 since 04/15/2026. The exploitability is told to be easy. It is possible to initiate the attack remotely. Technical details are known, but no exploit is available. MITRE ATT&CK project uses the attack technique T1006 for this issue. Upgrading to version 2.0.0-beta.6 eliminates this vulnerability. Productinfo Vendor patrickhener Name goshs Version 2.0.0-beta.0 2.0.0-beta.1 2.0.0-beta.2 2.0.0-beta.3 2.0.0-beta.4 2.0.0-beta.5 Website Product: https://github.com/patrickhener/goshs/ CPE 2.3info 🔒 🔒 🔒 CPE 2.2info 🔒 🔒 🔒 CVSSv4info VulDB Vector: 🔒 VulDB Reliability: 🔍 CNA CVSS-B Score: 🔒 CNA CVSS-BT Score: 🔒 CNA Vector: 🔒 CVSSv3info VulDB Meta Base Score: 6.3 VulDB Meta Temp Score: 6.0 VulDB Base Score: 6.3 VulDB Temp Score: 6.0 VulDB Vector: 🔒 VulDB Reliability: 🔍 CVSSv2info Vector Complexity Authentication Confidentiality Integrity Availability Unlock Unlock Unlock Unlock Unlock Unlock Unlock Unlock Unlock Unlock Unlock Unlock Unlock Unlock Unlock Unlock Unlock Unlock VulDB Base Score: 🔒 VulDB Temp Score: 🔒 VulDB Reliability: 🔍 Exploitinginfo Class: Path traversal CWE: CWE-22 CAPEC: 🔒 ATT&CK: 🔒 Physical: No Local: No Remote: Yes Availability: 🔒 Status: Not defined Price Prediction: 🔍 Current Price Estimation: 🔒 0-Day Unlock Unlock Unlock Unlock Today Unlock Unlock Unlock Unlock Threat Intelligenceinfo Interest: 🔍 Active Actors: 🔍 Active APT Groups: 🔍 Countermeasuresinfo Recommended: Upgrade Status: 🔍 0-Day Time: 🔒 Upgrade: goshs 2.0.0-beta.6 Timelineinfo 04/15/2026 CVE reserved 04/21/2026 +6 days Advisory disclosed 04/21/2026 +0 days VulDB entry created 04/21/2026 +0 days VulDB entry last update Sourcesinfo Product: github.com Advisory: GHSA-5h6h-7rc9-3824 Status: Confirmed CVE: CVE-2026-40876 (🔒) GCVE (CVE): GCVE-0-2026-40876 GCVE (VulDB): GCVE-100-358569 Entryinfo Created: 04/21/2026 22:29 Changes: 04/21/2026 22:29 (69) Complete: 🔍 Cache ID: 99:ECE:101 Discussion No comments yet. Languages: en. Please log in to comment. ◂ PreviousOverviewNext ▸
    💬 Team Notes
    Article Info
    Source
    VulDB
    Category
    ⬡ Vulnerabilities & CVEs
    Published
    Apr 22, 2026
    Archived
    Apr 22, 2026
    Full Text
    ✓ Saved locally
    Open Original ↗