What Changed in v2.1.8
This is a security-focused release resolving thirteen advisories. Most close gaps in how the per-folder .goshs ACL and the --no-delete / --upload-only mode flags are enforced across the many protocols that serve the webroot. It also adds a way to run goshs without the HTTP server, makes mDNS advertisement actually stay on, fixes clipboard copy over plain HTTP, and brings the usual dependency and CI maintenance.
🔒 Security
Critical
- SMB
IPC$pipe name used as a filesystem path (GHSA-p6c9-h3f7-xq9f, Critical): the client-supplied pipe name of anIPC$handle was stored as the handle's path, so an unauthenticated client could delete arbitrary files via a delete-on-close disposition. Pipe handles now keep their name separately and never touch the filesystem:SET_INFOon a pipe is refused, andCLOSEnever deletes one. X-Forwarded-Forspoofing bypasses the IP whitelist (GHSA-6vcx-pgmj-8c8g, Critical): behind a reverse proxy, goshs trusted the leftmostX-Forwarded-Forentry, which is client-controlled when the proxy appends. Forwarded headers are now only read when the TCP peer is in--trusted-proxy-whitelist, the chain is walked right-to-left skipping trusted hops, and unparsable hops fail closed. This affects both the IP whitelist and the brute-force lockout key.
Content destruction under --no-delete / --upload-only
- FTP
REST+STORoverwrites files in place (GHSA-qwpj-g46h-59wx, High): incomplete fix of GHSA-6wwv-mx7w-35jx. A resumed upload (REST <n>thenSTOR) opens the file withoutO_TRUNCand seeks, overwriting everything after the firstnbytes while--no-deletewas active. Every write to an existing file except a pure append is now refused, and new files are created exclusively so a file that appears mid-request is never clobbered. --upload-onlydoes not protect existing files over FTP and SFTP (GHSA-c3p2-6762-cf9j, High): in drop-box mode FTP only blocked downloads, soSTORover existing files,RNFR/RNTO,DELEandSITE RMDIRstill worked, and SFTP truncated existing files on upload. Upload-only now gets the same protection as--no-deleteon both protocols, matching HTTP, WebDAV, TFTP and SMB.- Recursive delete destroys protected subtrees (GHSA-rf62-vgq5-ggq5, High): the ACL was resolved for the addressed path only, but a recursive delete removes everything below it, so deleting an unprotected parent (or
DELETE /) wiped auth-protected and block-listed subtrees. Recursive deletes over HTTP, WebDAV, FTP and SFTP now check the whole subtree first, and the webroot itself can never be removed. - Fixed temp path
<name>~clobbers files on upload (GHSA-5q79-f559-j56x, Medium): incomplete fix of GHSA-966r-mw4j-rv64. Multipart uploads staged into a fixed<name>~file, truncating and consuming a pre-existing file of that name under--no-delete/--upload-only. Uploads now stage into a unique temp file and, under those flags, finalize without ever replacing an existing target. - SMB ADS null-sink escapes the share (GHSA-4wmw-c376-phcm, Medium): names containing
:(alternate data streams such asZone.Identifier) took a shortcut that stored the raw client path, allowing unauthenticated deletion and moves outside the share. They now go through the same path containment and ACL checks as every other name, are never deleted onCLOSE, and cannot be renamed.
Per-folder .goshs ACL bypasses
- Nested folder upload ignores sub-directory ACLs (GHSA-625w-3rc8-3c3h, High): folder uploads keep each file's sub-path, but only the target directory's ACL was checked, so a part could be written into a deeper, auth-protected directory without credentials. The ACL is now evaluated for every part's own directory.
- Rename moves a subtree out of its
.goshsscope (GHSA-95fx-g5c4-6f8f, Medium): block entries and inherited auth live in an ancestor.goshs, so renaming the directory that contains a protected file served that file at its new path. Directory renames over WebDAV, FTP, SFTP and SMB are now only allowed when nothing below is protected, or when the destination keeps at least the same constraints. - Blocked folders (
"name/") exposed outside the HTTP listing (GHSA-5v54-7vcp-2f4h, Medium): folder block entries were only applied by the HTTP directory listing. WebDAVPROPFIND, FTP/SFTP/SMB listings and a?bulkzip of the parent folder listed and served the hidden folder without needing its name. Blocked folders are now hidden from every listing and cannot be opened or listed on any protocol, skipped by the bulk archive, and refused for share links. A nested blocked folder requested directly over HTTP now also returns 404. As documented, a file inside a blocked folder is still reachable by its exact path. - Windows trailing-dot / 8.3 names bypass the block list (GHSA-wh5w-m4vw-7mjm, Medium): incomplete fix of GHSA-3x28-6v7h-gg87 / CVE-2026-66064. Windows opens
secret.txt.,secret.txtand the 8.3 short nameSECRET~1.TXTassecret.txt, so these spellings slipped past the block list and the.goshsguard. Names are now normalized (trailing dots and spaces stripped) and short names resolved to the real entry before every check. - Trailing-dot
.goshsalias overwrites the ACL file (GHSA-8v6q-gvgc-m3vq, Medium): the same alias class on the write side. An anonymousPUT /.goshs.(or an upload named.goshs.) created or replaced the real ACL file on Windows. Every create path now uses the alias-aware check. (Duplicate report: GHSA-fqxq-xh82-pcgh.)
Web UI
- Stored XSS via chat reaction emoji (GHSA-hwm6-6mhm-83f5, High): the reaction hover tooltip inserted the raw reaction key into the page, so any chat participant (including anonymous ones) could run script in every other viewer's session. The key is now escaped, and the server only accepts short, valid emoji-like reactions.
✨ New Features
-
Run without the HTTP server (#351):
-nh/--no-http, or"http_server": falsein the config file, starts goshs with only the other protocols (FTP, SMB, LDAP, DNS, …) and no web listener. Config files without the key keep the web server on. The TUI, including the reverse-shell catcher, keeps working, and--userstill drops privileges after all listeners are bound. goshs refuses to start with--tunnel(which exposes the web server) or when nothing else is enabled.# Only FTP and LDAP, no web server ./goshs -nh -ftp -ldap
🐛 Bug Fixes
- mDNS advertisement never stayed on: every registered service was withdrawn the moment registration finished, so
-m/--mdnseffectively advertised nothing. Services now stay registered for the lifetime of the process and are withdrawn cleanly on shutdown. With--no-httpthe web service is no longer advertised. - Copy buttons broken over plain HTTP (#319): the browser clipboard API only exists in secure contexts, so every copy button threw an error when goshs was reached over plain HTTP from another host. Copying now falls back to a method that works without HTTPS.
- Wrong
Content-Typefor files without an extension (#342): a file named e.g.pngwas treated as having the extension.pngand served asimage/png. Extension-less files now have no extension, both for the servedContent-Typeand the listing icon.
🛠️ Build, CI & Packaging
- Docker builder (
golang:1.27-alpine) and runtimealpinebase images refreshed. - README: security contributor acknowledgements updated.
⬆️ Dependencies
- Go modules:
golang.org/x/crypto0.57.0 → 0.59.0,golang.org/x/net0.59.0 → 0.62.0,golang.org/x/term0.46.0 → 0.48.0,golang.org/x/text0.42.0 → 0.44.0,github.com/fclairamb/ftpserverlib0.32.4 → 0.33.3,github.com/pkg/sftp1.13.11 → 1.13.12,github.com/emersion/go-smtp0.25.0 → 0.26.0,software.sslmate.com/src/go-pkcs120.7.3 → 0.7.4,github.com/go-jose/go-jose/v44.1.4 → 4.1.6,go.opentelemetry.io/otel/trace1.44.0 → 1.47.0,github.com/moby/moby/api1.56.0 → 1.57.0,github.com/testcontainers/testcontainers-go0.44.0 → 0.45.0. - GitHub Actions:
github/codeql-action(init/autobuild/analyze/upload-sarif) 4.38.2 → 4.39.3,docker/login-action4.6.0 → 4.8.0,goreleaser/goreleaser-action7.2.3 → 7.3.0,ossf/scorecard-action2.4.4 → 2.5.0,sigstore/cosign-installer4.1.2 → 4.1.3,actions/upload-artifact7.0.1 → 7.0.2,actions/download-artifact8.0.1 → 8.0.2. - Docker:
golang1.27-alpine andalpinebase digest refreshes.