github goshs-labs/goshs v2.1.8

one hour ago

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 an IPC$ 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_INFO on a pipe is refused, and CLOSE never deletes one.
  • X-Forwarded-For spoofing bypasses the IP whitelist (GHSA-6vcx-pgmj-8c8g, Critical): behind a reverse proxy, goshs trusted the leftmost X-Forwarded-For entry, 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 + STOR overwrites files in place (GHSA-qwpj-g46h-59wx, High): incomplete fix of GHSA-6wwv-mx7w-35jx. A resumed upload (REST <n> then STOR) opens the file without O_TRUNC and seeks, overwriting everything after the first n bytes while --no-delete was 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-only does not protect existing files over FTP and SFTP (GHSA-c3p2-6762-cf9j, High): in drop-box mode FTP only blocked downloads, so STOR over existing files, RNFR/RNTO, DELE and SITE RMDIR still worked, and SFTP truncated existing files on upload. Upload-only now gets the same protection as --no-delete on 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 as Zone.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 on CLOSE, 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 .goshs scope (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. WebDAV PROPFIND, FTP/SFTP/SMB listings and a ?bulk zip 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.txt and the 8.3 short name SECRET~1.TXT as secret.txt, so these spellings slipped past the block list and the .goshs guard. Names are now normalized (trailing dots and spaces stripped) and short names resolved to the real entry before every check.
  • Trailing-dot .goshs alias overwrites the ACL file (GHSA-8v6q-gvgc-m3vq, Medium): the same alias class on the write side. An anonymous PUT /.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": false in 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 --user still 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 / --mdns effectively advertised nothing. Services now stay registered for the lifetime of the process and are withdrawn cleanly on shutdown. With --no-http the 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-Type for files without an extension (#342): a file named e.g. png was treated as having the extension .png and served as image/png. Extension-less files now have no extension, both for the served Content-Type and the listing icon.

🛠️ Build, CI & Packaging

  • Docker builder (golang:1.27-alpine) and runtime alpine base images refreshed.
  • README: security contributor acknowledgements updated.

⬆️ Dependencies

  • Go modules: golang.org/x/crypto 0.57.0 → 0.59.0, golang.org/x/net 0.59.0 → 0.62.0, golang.org/x/term 0.46.0 → 0.48.0, golang.org/x/text 0.42.0 → 0.44.0, github.com/fclairamb/ftpserverlib 0.32.4 → 0.33.3, github.com/pkg/sftp 1.13.11 → 1.13.12, github.com/emersion/go-smtp 0.25.0 → 0.26.0, software.sslmate.com/src/go-pkcs12 0.7.3 → 0.7.4, github.com/go-jose/go-jose/v4 4.1.4 → 4.1.6, go.opentelemetry.io/otel/trace 1.44.0 → 1.47.0, github.com/moby/moby/api 1.56.0 → 1.57.0, github.com/testcontainers/testcontainers-go 0.44.0 → 0.45.0.
  • GitHub Actions: github/codeql-action (init/autobuild/analyze/upload-sarif) 4.38.2 → 4.39.3, docker/login-action 4.6.0 → 4.8.0, goreleaser/goreleaser-action 7.2.3 → 7.3.0, ossf/scorecard-action 2.4.4 → 2.5.0, sigstore/cosign-installer 4.1.2 → 4.1.3, actions/upload-artifact 7.0.1 → 7.0.2, actions/download-artifact 8.0.1 → 8.0.2.
  • Docker: golang 1.27-alpine and alpine base digest refreshes.

Don't miss a new goshs release

NewReleases is sending notifications on new releases.