{"answers":{"affected":"6 open source packages ship an affected version, including github.com/patrickhener/goshs and github.com/patrickhener/goshs/v2.","exploited":"There is no known exploitation of GHSA-7qx6-f23w-3w7f in the wild and no public exploit code.","fix":"No fix has been published for GHSA-7qx6-f23w-3w7f yet. Limit exposure of the affected software until one is available.","what":"GHSA-7qx6-f23w-3w7f is a vulnerability in github.com/patrickhener/goshs, published on 14 Apr 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for GHSA-7qx6-f23w-3w7f and fix it if it is affected.\n\nWhat it is: GHSA-7qx6-f23w-3w7f is a vulnerability in github.com/patrickhener/goshs, published on 14 Apr 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of GHSA-7qx6-f23w-3w7f in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/patrickhener/goshs (Go): affected all versions; no fix listed\n- github.com/patrickhener/goshs (Go): affected all versions up to 1.1.4; no fix listed\n- github.com/patrickhener/goshs (Go): affected all versions up to 1.1.4; no fix listed\n- github.com/patrickhener/goshs/v2 (Go): affected all versions; no fix listed\n- github.com/patrickhener/goshs/v2 (Go): affected all versions up to 2.0.0-beta.6; no fix listed\n- github.com/patrickhener/goshs/v2 (Go): affected all versions up to 2.0.0-beta.6; no fix listed\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-7qx6-f23w-3w7f/ (Markdown: https://insights.sbomify.com/GHSA-7qx6-f23w-3w7f/index.md)","id":"GHSA-7qx6-f23w-3w7f","markdown":"https://insights.sbomify.com/GHSA-7qx6-f23w-3w7f/index.md","name":"GHSA-7qx6-f23w-3w7f","record":{"aliases":["GO-2026-5232"],"analysis":{"component_type":"server_software","fix_type":"patch","impacts":["security_bypass","data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"Go file server","requires_auth":"none","summary":"Attackers can exploit unauthenticated open redirect and header injection in goshs to bypass security controls and fingerprint stealth deployments.","user_interaction":"required","vuln_class":"open_redirect"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### 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### 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 \u003c 300 || code \u003e 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\u003cimg width=\"1379\" height=\"197\" alt=\"스크린샷 2026-04-13 오후 8 04 20\" src=\"https://github.com/user-attachments/assets/a557846f-47c7-4640-9fc5-34aa099d1a57\" /\u003e\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.","ecosystems":["Go"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":false,"headline":"The `GET /?redirect` endpoint in `goshs` v2.0.0-beta.6 performs an HTTP redirect to any attacker-supplied `url=` value and write","id":"GHSA-7qx6-f23w-3w7f","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Go","product":null,"products":[],"type":"open_redirect","year":"2026"},"n_packages":6,"n_references":null,"packages":[{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":[],"package":"github.com/patrickhener/goshs","purl":"pkg:golang/github.com/patrickhener/goshs","source":"GO-2026-5232"},{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":["1.1.4"],"package":"github.com/patrickhener/goshs","purl":null,"source":"GHSA-7qx6-f23w-3w7f"},{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":["1.1.4"],"package":"github.com/patrickhener/goshs","purl":"pkg:golang/github.com/patrickhener/goshs","source":"GHSA-7qx6-f23w-3w7f"},{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":[],"package":"github.com/patrickhener/goshs/v2","purl":"pkg:golang/github.com/patrickhener/goshs/v2","source":"GO-2026-5232"},{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":["2.0.0-beta.6"],"package":"github.com/patrickhener/goshs/v2","purl":null,"source":"GHSA-7qx6-f23w-3w7f"},{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":["2.0.0-beta.6"],"package":"github.com/patrickhener/goshs/v2","purl":"pkg:golang/github.com/patrickhener/goshs/v2","source":"GHSA-7qx6-f23w-3w7f"}],"products":null,"published":"2026-04-14","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can exploit unauthenticated open redirect and header injection in goshs to bypass security controls and fingerprint stealth deployments.","url":"https://insights.sbomify.com/GHSA-7qx6-f23w-3w7f/"}