CVE-2026-34581
Authentication Bypass in goshs Allows Remote Code Execution
Publication date: 2026-04-02
Last updated on: 2026-04-15
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| goshs | goshs | From 1.1.0 (inc) to 2.0.0 (exc) |
| goshs | goshs | 2.0.0 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-288 | The product requires authentication, but the product has an alternate path or channel that does not require authentication. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2026-34581 is a critical authentication bypass vulnerability in the Go module "goshs" versions 1.1.0 through before 2.0.0-beta.2. The issue arises because the BasicAuthMiddleware checks for a URL query parameter `?token=` before performing standard authentication. If the token exists in the SharedLinks map, the middleware bypasses all authentication checks entirely and grants full access.
This means that possession of a valid share token, which was originally intended only for limited, single-file, time-restricted downloads, allows an attacker to access all goshs functionalities without restriction. These functionalities include directory listing, file deletion, clipboard access, WebSocket connections, and command-line interface command execution.
The vulnerability can be exploited remotely over the network with low attack complexity, requires no privileges, and no user interaction other than having the token.
How can this vulnerability impact me? :
An attacker who obtains a valid share token can bypass all authentication and gain unauthorized full access to the goshs server functionalities.
- They can list directories and access files beyond the intended limited download.
- They can delete files on the server.
- They can access the clipboard.
- They can establish WebSocket connections and execute arbitrary shell commands remotely.
This leads to a complete compromise of the confidentiality and integrity of the system, potentially exposing sensitive data and allowing malicious control over the server.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by checking for unauthorized use of the share token in URL query parameters, specifically the presence of `?token=` in requests to the goshs server. Since possession of a valid share token allows bypassing authentication and executing commands, monitoring network traffic for requests containing `?token=` followed by suspicious activity such as WebSocket connections or CLI command executions can indicate exploitation attempts.
Commands to detect exploitation attempts might include network traffic inspection tools like tcpdump or Wireshark to filter HTTP requests containing `?token=` parameters, for example:
- tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | grep '?token='
Additionally, reviewing server logs for requests with `?token=` parameters and any unusual WebSocket connections or CLI command executions can help detect exploitation.
What immediate steps should I take to mitigate this vulnerability?
The immediate step to mitigate this vulnerability is to upgrade the goshs server to version 2.0.0-beta.2 or later, where the authentication bypass issue has been patched.
Until the upgrade can be performed, restrict access to the goshs server to trusted networks or users, and monitor for any suspicious use of share tokens in URL parameters.
Additionally, consider disabling or limiting the use of share tokens if possible, to reduce the risk of unauthorized access.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The vulnerability in goshs allows an attacker with a valid share token to bypass authentication entirely and gain unauthorized full access to all server functionalities, including executing arbitrary commands. This leads to a complete compromise of confidentiality and integrity of the system.
Such a compromise of confidentiality and integrity can negatively impact compliance with common standards and regulations like GDPR and HIPAA, which require strict controls to protect sensitive data and ensure system integrity.
Because the vulnerability allows unauthorized access and potential data exposure or manipulation, affected organizations may face increased risk of non-compliance with these regulations.