GitHub Advisoryadvisory · Go

GHSA-wg2q-39h6-66x9 goshs has a Path Traversal issue

MEDIUM Published 2026-07-28 Modified 2026-07-28 Official page ↗
Aliases
CVE-2026-66063
Ecosystem
Go
Packages
goshs.de/goshs/v2, github.com/patrickhener/goshs/v2, goshs.de/goshs, github.com/patrickhener/goshs
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Weaknesses
CWE-22
Reviewed
2026-07-28

Affected packages

• Go goshs.de/goshs/v2: < 2.1.5-0.20260727065949-f3ef599e4091 → fixed in 2.1.5-0.20260727065949-f3ef599e4091 • Go github.com/patrickhener/goshs/v2: < 2.1.5-0.20260727065949-f3ef599e4091 → fixed in 2.1.5-0.20260727065949-f3ef599e4091 • Go goshs.de/goshs: <= 1.1.4 (no fix yet) • Go github.com/patrickhener/goshs: <= 1.1.4 (no fix yet)

Description

Summary The multipart upload filename fix splits on the path separator but never rejects dot-dot, allowing a write outside the served tree. Finding (Medium): upload filename escapes the served tree (residual of CVE-2026-35393) The multipart filename fix (updown.go lines 135-136) splits on the path separator but never rejects "..". Uploading with filename=".." results in os.Create against the parent of the upload folder with a trailing marker character, outside the served tree, and the subsequent failed rename leaves that file behind. Verified: a file containing ESCAPED_WRITE_PROOF was written outside the webroot, unauthenticated, with the default configuration. Not claimed: a Windows-specific variant (Go's Part.FileName() already applies filepath.Base). Suggested fixes 1. Reject any upload filename that is "..", is empty after sanitisation, or resolves outside the upload folder; validate the final resolved destination rather than only transforming the input. Tooling AI assistance was used while investigating. The finding was reproduced against a running server on loopback.

Related

Alias · CVE (1)

  • CVE-2026-66063 goshs is a feature-rich single-binary file server for red teamers and developers. vulnerability

Weakness · CWE (1)

  • CWE-22 Improper Limitation of a Pathname to a Restricted Directory weakness

References