Summary
The PUT upload handler (httpserver/updown.go) lacks the CSRF token validation that was added to the POST upload handler during the GHSA-jrq5-hg6x-j6g3 fix. Combined with the unconditional Access-Control-Allow-Origin: * on the OPTIONS preflight handler (httpserver/server.go), any website can write arbitrary files to a goshs instance through the victim's browser, bypassing network isolation (e.g. localhost, internal network).
Details
Root Cause 1, Missing CSRF on PUT (httpserver/updown.go:19)
When GHSA-jrq5-hg6x-j6g3 was fixed (commit e3c3d37), checkCSRF() was added to the POST upload() function (line 78) but not to the PUT put() function directly above it in the same file. This means PUT requests are accepted without any CSRF token.
// POST, protected
func (fs *FileServer) upload(w http.ResponseWriter, req *http.Request) {
if !fs.checkCSRF(w, req) { return }
// ...
}
// PUT, unprotected
func (fs *FileServer) put(w http.ResponseWriter, req *http.Request) {
// No checkCSRF call
// ...
}
Root Cause 2, Wildcard CORS (httpserver/server.go:126)
The OPTIONS handler unconditionally returns permissive CORS headers:
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, OPTIONS")
w.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization")
This allows any website's JavaScript to pass the browser's CORS preflight check and send PUT requests to the goshs server.
PoC
Please extract the uploaded compressed file before proceeding
- bash poc.sh
Impact
- Arbitrary file write to the goshs webroot from any website the victim visits
- File overwrite, existing files can be silently replaced
A victim's authenticated browser session is used to submit forged requests to an application that cannot distinguish them from legitimate ones. Typical impact: state-changing actions performed as the victim without their consent.
CVE-2026-42091 has a CVSS score of 6.5 (Medium). The vector is network-reachable, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.0.2); upgrading removes the vulnerable code path.
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
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-42091? CVE-2026-42091 is a medium-severity cross-site request forgery (CSRF) vulnerability in github.com/patrickhener/goshs/v2 (go), affecting versions < 2.0.2. It is fixed in 2.0.2. A victim's authenticated browser session is used to submit forged requests to an application that cannot distinguish them from legitimate ones.
- How severe is CVE-2026-42091? CVE-2026-42091 has a CVSS score of 6.5 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2026-42091?
github.com/patrickhener/goshs/v2(go) (versions < 2.0.2)github.com/patrickhener/goshs(go) (versions <= 1.1.4)
- Is there a fix for CVE-2026-42091? Yes. CVE-2026-42091 is fixed in 2.0.2. Upgrade to this version or later.
- Is CVE-2026-42091 exploitable, and should I be worried? Whether CVE-2026-42091 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 CVE-2026-42091 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 CVE-2026-42091? Upgrade
github.com/patrickhener/goshs/v2to 2.0.2 or later.