CVE-2026-42091

goshs has Cross-Origin Arbitrary File Write via Missing CSRF on PUT and Wildcard CORS

Published May 4, 2026 CVSS 3.1 · 6.5 Medium EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

goshs implements a simple HTTP file upload service. In versions prior to 2.0.2 the PUT handler does not enforce CSRF protection, while the OPTIONS preflight handler sends an "Access‑Control‑Allow‑Origin: *" header. As a result, any web page that the victim visits can instruct the victim’s browser to perform a PUT request to the server and upload or overwrite an arbitrary file, thereby modifying the server’s file system. The CWE-352 classification reflects the cross‑site request forgery nature of this flaw.

Affected Systems

The vulnerable code is present in the goshs SimpleHTTPServer package produced by patrickhener. All releases before v2.0.2 contain the flaw; v2.0.2 adds CSRF validation for uploaded files and removes the wildcard CORS header, thereby patching the issue.

Risk and Exploitability

The CVSS score of 6.5 marks it as a medium‑level vulnerability. Because the exploit requires a victim browser to load a malicious site, the attack vector is client‑side; it can bypass network isolation such as localhost or internal networks. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog, indicating that no public exploits have been reported at the time of assessment. Nonetheless, the ability to write arbitrary files could enable malware deployment or configuration tampering if the server is accessible to unprivileged users.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to goshs version 2.0.2 or later, which implements CSRF protection for PUT uploads and removes the wildcard CORS header
  • If upgrading immediately is not possible, disable the PUT method on the server or require authentication before allowing file writes
  • Configure the server to return a stricter CORS policy, such as "Access‑Control‑Allow‑Origin: <trusted‑domain>" or remove the header entirely

Generated by OpenCVE AI on May 4, 2026 at 18:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-rhf7-wvw3-vjvm goshs has Cross-Origin Arbitrary File Write via Missing CSRF on PUT and Wildcard CORS
History
Type Values Removed Values Added
First Time appeared Goshs
Goshs goshs
CPEs cpe:2.3:a:goshs:goshs:*:*:*:*:*:go:*:*
Vendors & Products Goshs
Goshs goshs
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Patrickhener
Patrickhener goshs
Vendors & Products Patrickhener
Patrickhener goshs
Type Values Removed Values Added
Description 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.
Title goshs has Cross-Origin Arbitrary File Write via Missing CSRF on PUT and Wildcard CORS
Weaknesses CWE-352
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N'}

Weaknesses
  • CWE-352

    Cross-Site Request Forgery (CSRF)

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
May 5, 2026, 2:14 PM
Reserved
Apr 23, 2026, 7:17 PM
Status
Analyzed
Published
May 4, 2026, 6:16 PM
Modified
Oct 26, 2026, 7:10 PM