Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconVictim visits malicious website
-
DeliveryBrowser sends OPTIONS preflight to goshs
-
ExploitWildcard CORS response allows cross-origin requests
-
InstallBrowser sends crafted PUT request with file content
-
C2PUT handler receives request without CSRF check
-
ExecuteFile written to goshs webroot
-
ImpactAttacker achieves arbitrary file write
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V3 - Web Frontend Security Anti-CSRF tokens, SameSite cookies
MITRE ATT&CK
1 technique across 1 tactic: Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires: (1) the victim must have a goshs instance accessible from their browser (localhost:8000 or internal network URL), (2) the goshs instance must be running a version prior to 2.0.2 (v2.x) or any v1.x version, (3) the victim must visit a website controlled or compromised by the attacker while the goshs instance is running and accessible, and (4) for v2.x, basic HTTP authentication must NOT be configured (if basic auth is enabled, browsers cannot attach credentials to preflight requests, blocking exploitation). The attack vector is network-based and requires no authentication to the goshs server itself (the victim's browser credentials for localhost are implicit). User interaction is mandatory: the victim must visit a third-party website. No special goshs configuration beyond default settings is required to be vulnerable. |
| Impact | This vulnerability presents moderate-to-high real-world risk despite a CVSS score of 6.5. CVSS assigns medium severity (6.5) because user interaction is required (UI:R - the victim must visit a malicious website) and the attack vector is network-based but limited by same-origin policy circumvention (AV:N/AC:L/PR:N indicates no authentication needed and low complexity). However, the practical impact is significant: the vulnerability enables silent file overwrite on networked instances, particularly affecting deployments on localhost or internal networks where administrators may assume security through isolation. The combination of CSRF-less PUT + wildcard CORS creates a complete attack chain with publicly available exploit code, elevating real-world risk. Exploitation requires only that a victim with browser access to the goshs server visits a malicious website - a realistic threat in mixed-trust environments (e.g., developer accessing both internal file server and untrusted web content). The presence of a proof-of-concept (poc.zip in advisory) confirms exploitability. The limiting factor is scope (S:U - no privilege escalation), meaning the attacker cannot execute code or escalate privileges, only write files; this constrains but does not eliminate risk, as file overwrites can corrupt applications, inject malicious content (e.g., replacing HTML/JS served by goshs), or create denial-of-service conditions. For v1.x users, the absence of a vendor patch increases risk persistence. |
| Exploit ScenarioDerived | An attacker hosts a malicious website containing JavaScript that uses XMLHttpRequest or Fetch to send a PUT request to http://localhost:8000/malicious.html (or any target goshs server). When a developer or user with access to a goshs instance visits the attacker's site, the victim's browser automatically includes the request. The browser first sends an OPTIONS preflight request, which goshs responds to with Access-Control-Allow-Origin: *, allowing the PUT to proceed. The PUT request then reaches the PUT handler, which lacks CSRF validation, and the file is written to the goshs webroot. The attacker can overwrite existing files, inject malicious content into served HTML/JS, or create new files. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 04, 2026
goshs SimpleHTTPServer versions prior to 2.0.2 allow arbitrary file write via cross-origin PUT requests due to missing CSRF token validation on the PUT handler combined with permissive wildcard CORS headers. An attacker can trick a victim into visiting a malicious website which then writes arbitrary files to a goshs instance running on localhost or an internal network, bypassing network isolation protections. Publicly available exploit code exists, and the vulnerability affects all v2.x releases before 2.0.2 and all v1.x releases (no patch available for v1.x).
RemediationAI
Upgrade goshs to version 2.0.2 or later immediately. The patch adds CSRF token validation to the PUT handler (httpserver/updown.go:19) to match the POST handler protection, and modifies CORS handling to only enforce CSRF checks in unauthenticated deployments (when basic auth is not configured). For users unable to upgrade immediately, enable HTTP Basic Authentication (goshs -b flag or equivalent) on all instances; this mitigates the vulnerability because browsers cannot attach credentials to CORS preflight requests, causing the preflight to fail and preventing the actual PUT request from reaching the server. However, basic auth adds authentication overhead and is a compensating control, not a complete fix - upgrade to 2.0.2 is the only reliable remediation. Users on v1.x (1.1.4 and earlier) must migrate to v2.0.2 as no patch is available for v1.x. See GitHub advisory https://github.com/patrickhener/goshs/security/advisories/GHSA-rhf7-wvw3-vjvm and release page https://github.com/patrickhener/goshs/releases/tag/v2.0.2.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 5 packages in go, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
goshs is a lightweight HTTP file server written in Go that supports file upload and download. The vulnerability exploits two weaknesses in the HTTP request handling layer: (1) the PUT upload handler in httpserver/updown.go was not updated to include CSRF token validation when a similar fix was applied to the POST handler during the prior CVE-2026-40883 remediation, and (2) the OPTIONS preflight handler in httpserver/server.go returns Access-Control-Allow-Origin: * unconditionally, which allows browsers executing JavaScript from any origin to pass CORS preflight checks and send PUT requests. The root cause is CWE-352 (Cross-Site Request Forgery), where the application fails to validate that file-upload requests originate from the legitimate goshs web interface rather than a third-party website. Combined, these weaknesses allow cross-origin file uploads: a victim's browser receives a CORS preflight (OPTIONS) response permitting PUT, then the actual PUT request proceeds without CSRF token verification, resulting in arbitrary file write to the goshs webroot.
Know when Goshs gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Request Forgery exploits the automatic credential inclusion behavior of web browsers.
Critical authorization bypass in goshs (Go-based HTTP server) versions prior to 2.0.0-beta.4 allows unauthenticated atta
Improper enforcement of the `--no-delete` flag in goshs WebDAV server allows unauthorized file deletion or overwrite. Th
Path traversal in goshs file server allows unauthenticated remote attackers to write files outside the served directory
Remote unauthenticated attackers can leak GitHub workflow tokens from goshs repositories via ArtiPACKED attack. The vuln
Path traversal in patrickhener goshs SFTP rename operation enables authenticated attackers to write files outside the co
A path equivalence bypass in goshs lets attackers retrieve blocked files and the ACL configuration file by appending a t
EUVD-2026-27067
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB