Skip to content

Unauthenticated Open Redirect, Arbitrary HTTP Response Header Injection, Missing CSRF, and Invisible-Mode Bypass in goshs `/?redirect` endpoint

Low severity GitHub Reviewed Published Apr 13, 2026 in goshs-labs/goshs • Updated Apr 14, 2026

Package

gomod github.com/patrickhener/goshs (Go)

Affected versions

<= 1.1.4

Patched versions

None
gomod github.com/patrickhener/goshs/v2 (Go)
<= 2.0.0-beta.6
None

Description

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-787handleRedirect:

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-100BasicAuthMiddleware 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

  1. docker build -t goshs-poc .
  2. sh poc.sh

스크린샷 2026-04-13 오후 8 04 20

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.

References

@patrickhener patrickhener published to goshs-labs/goshs Apr 13, 2026
Published to the GitHub Advisory Database Apr 14, 2026
Reviewed Apr 14, 2026
Last updated Apr 14, 2026

Severity

Low

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N

EPSS score

Weaknesses

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. Learn more on MITRE.

CVE ID

No known CVE

GHSA ID

GHSA-7qx6-f23w-3w7f

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.