Goshs File-Based ACL Authorization Bypass Vulnerability
Goshs is vulnerable to an authorization bypass (CVE-2026-40189) due to inconsistent enforcement of .goshs ACLs on state-changing routes, allowing an unauthenticated attacker to manipulate files within protected directories and bypass authentication barriers.
The Goshs web server is susceptible to a critical authorization bypass (CVE-2026-40189) affecting versions up to and including 1.1.4 and v2.0.0-beta.3. The vulnerability stems from inconsistent enforcement of file-based ACLs defined by .goshs files. While the application correctly enforces authorization for reading and listing files, state-changing routes such as PUT, POST /upload, ?mkdir, and ?delete do not perform the same authorization checks. This allows unauthenticated attackers to upload, create, and delete files within directories that should be protected by authentication. The most severe impact arises from the ability to delete the .goshs file itself, thereby removing the authentication requirement and exposing previously protected content. This vulnerability undermines the intended security mechanisms of Goshs, posing a significant risk to data confidentiality, integrity, and availability.
Attack Chain
- The attacker identifies a Goshs instance utilizing
.goshsfiles for access control. - The attacker sends an unauthenticated PUT request to upload a file to a protected directory, bypassing ACL checks via
httpserver/updown.go:18-60. Example:PUT /protected/put-created.txt - Alternatively, the attacker sends an unauthenticated multipart POST request to
/uploadendpoint to upload a file to a protected directory, bypassing ACL checks viahttpserver/updown.go:63-165. Example:POST /protected/upload - The attacker sends an unauthenticated request with the
?mkdirparameter to create a directory within the protected directory, bypassing ACL checks viahttpserver/handler.go:901-937. Example:/?mkdir=new_directory - The attacker sends an unauthenticated request with the
?deleteparameter targeting the.goshsfile within the protected directory, leveraging the vulnerable route inhttpserver/handler.go:679-698. Example:/.goshs?delete - The server deletes the
.goshsfile usingos.RemoveAll(), effectively removing the access control restrictions for the directory. - The attacker sends an unauthenticated request to access previously protected files, which are now accessible due to the absence of the
.goshsfile. - The attacker gains unauthorized access to sensitive information and can perform further malicious actions, such as deleting or modifying critical files.
Impact
Successful exploitation of this vulnerability allows unauthenticated attackers to bypass intended access controls in Goshs deployments. This can lead to unauthorized access to sensitive files, potentially exposing confidential information. Attackers can also create, modify, or delete files within protected directories, causing data corruption or service disruption. The ability to delete the .goshs file directly amplifies the impact, as it permanently removes the authentication barrier, affecting all previously protected content. This vulnerability poses a significant threat to the confidentiality, integrity, and availability of Goshs-hosted data.
Recommendation
- Apply the vendor-supplied patch or upgrade to a version of Goshs that addresses CVE-2026-40189.
- Deploy the Sigma rule “Detect Goshs Unauthenticated .goshs Deletion” to your SIEM to detect attempts to remove
.goshsACL files via the?deleteparameter. - Deploy the Sigma rule “Detect Goshs Unauthenticated PUT Request to Protected Directories” to detect unauthorized file uploads to protected directories.
- Monitor web server logs for PUT, POST, and DELETE requests targeting directories containing
.goshsfiles to identify potential exploitation attempts. (Log Source: webserver)
Detection coverage 3
Detect Goshs Unauthenticated .goshs Deletion
criticalDetects attempts to delete .goshs ACL files via the ?delete parameter, indicating a potential authorization bypass.
Detect Goshs Unauthenticated PUT Request to Protected Directories
highDetects PUT requests to directories that should be protected by .goshs ACLs, indicating a potential authorization bypass.
Detect Goshs Unauthenticated Directory Creation via mkdir
mediumDetects requests with the `?mkdir` parameter, indicating a potential authorization bypass.
Detection queries are kept inside the platform. Get full rules →
Indicators of compromise
4
url
| Type | Value |
|---|---|
| url | http://127.0.0.1:18091/protected/ |
| url | http://127.0.0.1:18091/protected/put-created.txt |
| url | http://127.0.0.1:18091/protected/.goshs?delete |
| url | http://127.0.0.1:18091/protected/secret.txt |