goshs has Cross-Origin Arbitrary File Write via Missing CSRF on PUT and Wildcard CORS
patrickhener goshs
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/patrickhener/goshs/v2 Go |
|
|
| github.com/patrickhener/goshs Go |
| No fix yet |
| goshs.de/goshs Go |
patrickhener goshs
| Product | Affected | Fixed in |
|---|---|---|
| github.com/patrickhener/goshs/v2 Go |
|
|
| github.com/patrickhener/goshs Go |
| No fix yet |
| goshs.de/goshs Go |
|
| No fix yet |
| goshs.de/goshs/v2 Go |
|
|
goshs is a SimpleHTTPServer written in Go. Prior to version 2.0.2, the PUT upload handler (httpserver/updown.go) lacks the CSRF token validation that was added to the POST upload handler during the CVE-2026-40883 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). This issue has been patched in version 2.0.2.
From the CVE record · GitHub_M
The goshs PUT upload handler lacks CSRF token validation, and its OPTIONS handler allows preflight requests from any origin. An attacker-controlled website can use a victim's browser to write arbitrary files to a goshs instance, including one reachable only on localhost or an internal network. The victim must visit the website; the input does not specify an authentication requirement.
Check deployments using github.com/patrickhener/goshs/v2 or goshs.de/goshs/v2 before 2.0.2, or any version of github.com/patrickhener/goshs or goshs.de/goshs.