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:
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:
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
Please extract the uploaded compressed file before proceeding
- docker build -t goshs-poc .
- sh poc.sh
Impact
- Cross-subdomain session fixation,
Set-Cookie: …; Domain=.corp.comlands a fixed session on every sibling app on the parent domain. - TLS downgrade,
Strict-Transport-Security: max-age=0invalidates prior HSTS state for the origin, enabling MITM on subsequent visits.
Untrusted input controls a URL used for redirection, which can forward users to attacker-controlled sites. Typical impact: phishing and credential harvesting via a trusted domain.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
In the interim: Validate redirect destinations against an allowlist of permitted URLs or paths. Reject destinations that include an unexpected authority component.
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is GHSA-7QX6-F23W-3W7F? GHSA-7QX6-F23W-3W7F is a low-severity open redirect vulnerability in github.com/patrickhener/goshs (go), affecting versions <= 1.1.4. No fixed version is listed yet. Untrusted input controls a URL used for redirection, which can forward users to attacker-controlled sites.
- Which packages are affected by GHSA-7QX6-F23W-3W7F?
github.com/patrickhener/goshs(go) (versions <= 1.1.4)github.com/patrickhener/goshs/v2(go) (versions <= 2.0.0-beta.6)
- Is there a fix for GHSA-7QX6-F23W-3W7F? No fixed version is listed for GHSA-7QX6-F23W-3W7F yet. Monitor the advisory for updates and apply mitigations in the interim.
- Is GHSA-7QX6-F23W-3W7F exploitable, and should I be worried? Whether GHSA-7QX6-F23W-3W7F is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-7QX6-F23W-3W7F is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-7QX6-F23W-3W7F? No fixed version is listed yet. In the interim: Validate redirect destinations against an allowlist of permitted URLs or paths. Reject destinations that include an unexpected authority component.