GHSA-7qx6-f23w-3w7f: Github.com/patrickhener/goshs Unauthenticated Open Redirect, Arbitrary HTTP Vulnerability

LOW
CVSS 0.0
CWE-601
Published
Advisory Summary

GHSA-7qx6-f23w-3w7f is a LOW (CVSS 0.0) unauthenticated open redirect, arbitrary http vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Github.com/patrickhener/goshs libraries in the Go ecosystem. The issue involves unauthenticated open redirect, arbitrary http response header injection, missing csrf, and invisible-mode bypass in goshs `/?redirect` endpoint. Remediation is available in the latest vendor maintenance releases.

GHSA-7qx6-f23w-3w7f at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-7qx6-f23w-3w7f
Severity LOW
CVSS v3.1 Base Score 0.0
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Github.com/patrickhener/goshs
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 0.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-7qx6-f23w-3w7f

To remediate this vulnerability, upgrade all affected Github.com/patrickhener/goshs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/patrickhener/goshs fixed: Latest secure release
Upgrade github.com/patrickhener/goshs to Latest secure release
github.com/patrickhener/goshs/v2 fixed: Latest secure release
Upgrade github.com/patrickhener/goshs/v2 to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/patrickhener/goshs

How to Check if You Are Affected

To determine whether your application is affected by GHSA-7qx6-f23w-3w7f, inspect your project dependencies for Github.com/patrickhener/goshs:

inspect dependencies for github.com/patrickhener/goshs

Analyze the terminal output to locate any version of Github.com/patrickhener/goshs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Github.com/patrickhener/goshs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary The `GET /?redirect` endpoint in `goshs` v2.0.0-beta.6 performs an HTTP redirect to any attacker-supplied `url=` value and writes any attacker-supplied `header=Name: Value` pair into the response, without scheme/host validation, without a header-name allow-list, without authentication in the default deployment, and without the `checkCSRF()` guard that GHSA-jrq5-hg6x-j6g3 added to the other state-changing GET routes (`?mkdir`, `?delete`). The same dispatcher also lacks an `fs.Invisible` branch, so the endpoint stays responsive in `-I` stealth mode and reliably fingerprints an "invisible" goshs deployment with a single request. ### Details `httpserver/handler.go:222-228` — the dispatcher gates `?redirect` only with `denyForTokenAccess` (which only blocks share-token callers). It does not check `fs.Invisible` and does not call `checkCSRF`: ```go if _, ok := req.URL.Query()["redirect"]; ok { if denyForTokenAccess(w, req) { return true } fs.handleRedirect(w, req) return true } ``` `httpserver/handler.go:753-787` — `handleRedirect`: ```go func (fs *FileServer) handleRedirect(w http.ResponseWriter, req *http.Request) { q := req.URL.Query() target := q.Get("url") // (1) no scheme/host validation if target == "" { /* 400 */ } status := http.StatusFound if s := q.Get("status"); s != "" { // (2) only constrained to 3xx code, err := strconv.Atoi(s) if err != nil || code < 300 || code > 399 { /* 400 */ } status = code } for _, h := range q["header"] { // (3) arbitrary header set parts := strings.SplitN(h, ": ", 2) if len(parts) != 2 || strings.TrimSpace(parts[0]) == "" { /* 400 */ } w.Header().Set(strings.TrimSpace(parts[0]), parts[1]) } http.Redirect(w, req, target, status) // (4) attacker Location body := fs.emitCollabEvent(req, status) logger.LogRequest(req, status, fs.Verbose, fs.Webhook, body) } ``` `httpserver/server.go:85-100` — `BasicAuthMiddleware` is registered only when `fs.User != "" || fs.Pass != ""`; the default `goshs` invocation has neither, so `?redirect` is open to anyone on the network._Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer._ ### PoC [poc.zip](https://github.com/user-attachments/files/26673401/poc.zip) Please extract the uploaded compressed file before proceeding 1. docker build -t goshs-poc . 2. sh poc.sh <img width="1379" height="197" alt="스크린샷 2026-04-13 오후 8 04 20" src="https://github.com/user-attachments/assets/a557846f-47c7-4640-9fc5-34aa099d1a57" /> ### Impact - Cross-subdomain session fixation — `Set-Cookie: …; Domain=.corp.com` lands a fixed session on every sibling app on the parent domain. - TLS downgrade — `Strict-Transport-Security: max-age=0` invalidates prior HSTS state for the origin, enabling MITM on subsequent visits.

GHSA-7qx6-f23w-3w7f Affected Github.com/patrickhener/goshs Versions

2 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
github.com/patrickhener/goshs
Go
≤ 1.1.4
github.com/patrickhener/goshs/v2
Go
≤ 2.0.0-beta.6

References

Frequently Asked Questions

What is GHSA-7qx6-f23w-3w7f?
GHSA-7qx6-f23w-3w7f is a security vulnerability in Github.com/patrickhener/goshs involving Unauthenticated Open Redirect, Arbitrary HTTP Response Header Injection, Missing CSRF, and Invisible-Mode Bypass in goshs `/?redirect` endpoint under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Github.com/patrickhener/goshs versions are affected?
Affected versions include releases prior to current release patches across affected packages: github.com/patrickhener/goshs, github.com/patrickhener/goshs/v2.
What version fixes GHSA-7qx6-f23w-3w7f?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/patrickhener/goshs affected?
Yes, github.com/patrickhener/goshs is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
Is github.com/patrickhener/goshs/v2 affected?
Yes, github.com/patrickhener/goshs/v2 is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of GHSA-7qx6-f23w-3w7f?
GHSA-7qx6-f23w-3w7f has a CVSS v3.1 base score of 0.0 (LOW) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N.
What CWE is associated with GHSA-7qx6-f23w-3w7f?
GHSA-7qx6-f23w-3w7f is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check Go dependencies for GHSA-7qx6-f23w-3w7f?
Run the dependency tree command: 'inspect dependencies for github.com/patrickhener/goshs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7qx6-f23w-3w7f",
  "modified" : "2026-04-14T22:53:34Z",
  "published" : "2026-04-14T22:53:33Z",
  "aliases" : [ ],
  "summary" : "Unauthenticated Open Redirect, Arbitrary HTTP Response Header Injection, Missing CSRF, and Invisible-Mode Bypass in goshs `/?redirect` endpoint",
  "details" : "### Summary\nThe `GET /?redirect` endpoint in `goshs` v2.0.0-beta.6 performs an HTTP redirect to any attacker-supplied `url=` value and writes any attacker-supplied `header=Name: Value` pair into the response, without scheme/host validation, without a header-name allow-list, without authentication in the default deployment, and without the `checkCSRF()` guard that GHSA-jrq5-hg6x-j6g3 added to the other state-changing GET routes (`?mkdir`, `?delete`). The same dispatcher also lacks an `fs.Invisible` branch, so the endpoint stays responsive in `-I` stealth mode and reliably fingerprints an \"invisible\" goshs deployment with a single request.\n\n\n### Details\n`httpserver/handler.go:222-228` — the dispatcher gates `?redirect` only with `denyForTokenAccess` (which only blocks share-token callers). It does not check `fs.Invisible` and does not call `checkCSRF`:\n\n```go\nif _, ok := req.URL.Query()[\"redirect\"]; ok {\n    if denyForTokenAccess(w, req) {\n        return true\n    }\n    fs.handleRedirect(w, req)\n    return true\n}\n```\n\n`httpserver/handler.go:753-787` — `handleRedirect`:\n\n```go\nfunc (fs *FileServer) handleRedirect(w http.ResponseWriter, req *http.Request) {\n    q := req.URL.Query()\n\n    target := q.Get(\"url\")                                   // (1) no scheme/host validation\n    if target == \"\" { /* 400 */ }\n\n    status := http.StatusFound\n    if s := q.Get(\"status\"); s != \"\" {                        // (2) only constrained to 3xx\n        code, err := strconv.Atoi(s)\n        if err != nil || code < 300 || code > 399 { /* 400 */ }\n        status = code\n    }\n\n    for _, h := range q[\"header\"] {                          // (3) arbitrary header set\n        parts := strings.SplitN(h, \": \", 2)\n        if len(parts) != 2 || strings.TrimSpace(parts[0]) == \"\" { /* 400 */ }\n        w.Header().Set(strings.TrimSpace(parts[0]), parts[1])\n    }\n\n    http.Redirect(w, req, target, status)                    // (4) attacker Location\n\n    body := fs.emitCollabEvent(req, status)\n    logger.LogRequest(req, status, fs.Verbose, fs.Webhook, body)\n}\n```\n\n`httpserver/server.go:85-100` — `BasicAuthMiddleware` is registered only when `fs.User != \"\" || fs.Pass != \"\"`; the default `goshs` invocation has neither, so `?redirect` is open to anyone on the network._Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer._\n\n### PoC\n[poc.zip](https://github.com/user-attachments/files/26673401/poc.zip)\nPlease extract the uploaded compressed file before proceeding\n\n1. docker build -t goshs-poc .\n2. sh poc.sh\n\n<img width=\"1379\" height=\"197\" alt=\"스크린샷 2026-04-13 오후 8 04 20\" src=\"https://github.com/user-attachments/assets/a557846f-47c7-4640-9fc5-34aa099d1a57\" />\n\n\n### Impact\n- Cross-subdomain session fixation — `Set-Cookie: …; Domain=.corp.com` lands a fixed session on every sibling app on the parent domain.\n- TLS downgrade — `Strict-Transport-Security: max-age=0` invalidates prior HSTS state for the origin, enabling MITM on subsequent visits.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/patrickhener/goshs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.1.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/patrickhener/goshs/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "2.0.0-beta.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/patrickhener/goshs/security/advisories/GHSA-7qx6-f23w-3w7f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/patrickhener/goshs"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-14T22:53:33Z",
    "nvd_published_at" : null
  }
}