SCA: security update for github.com/patrickhener/goshs/v2 (GHSA-5h6h-7rc9-3824)

high Tenable Self-Hosted Container Security Plugin ID 440403

Description

There are packages installed that are affected by a vulnerability referenced in the following CVE:

- 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.
(CVE-2026-40876)

Solution

Update the github.com/patrickhener/goshs/v2 library and its related packages to version 2.0.0 or later.

See Also

https://github.com/advisories/GHSA-5h6h-7rc9-3824

Plugin Details

Severity: High

ID: 440403

Version: Revision 1.9

Type: Local

Family: SCA Checks

Published: 4/15/2026

Updated: 7/2/2026

Supported Sensors: Tenable Cloud Security, Tenable Self-Hosted Container Security

Risk Information

VPR

Risk Factor: Medium

Score: 4.9

Percentile: 57.88

Vendor

Vendor Severity: High

CVSS v2

Risk Factor: High

Base Score: 9

Temporal Score: 7

Vector: CVSS2#AV:N/AC:L/Au:S/C:C/I:C/A:C

CVSS Score Source: CVE-2026-40876

CVSS v3

Risk Factor: High

Base Score: 8.8

Temporal Score: 7.9

Vector: CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Temporal Vector: CVSS:3.0/E:P/RL:O/RC:C

CVSS v4

Risk Factor: High

Base Score: 8.7

Threat Score: 7.4

Threat Vector: CVSS:4.0/E:P

Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Vulnerability Information

Exploit Available: true

Exploit Ease: Exploits are available

Patch Publication Date: 4/14/2026

Vulnerability Publication Date: 4/14/2026

Reference Information

CVE: CVE-2026-40876

cwe: CWE-22