CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-62325

CVE-2026-62325: Authentication Bypass in goshs SFTP Server via Missing Password Check

Amit Schendel
Amit Schendel
Senior Security Researcher

Jul 29, 2026·6 min read·1 visit

Executive Summary (TL;DR)

Configuring the goshs file server with an empty password causes the SFTP engine to bypass password handler registration. This defaults the underlying gliderlabs/ssh library to NoClientAuth=true, allowing unauthenticated network clients to gain full SFTP access.

A critical authentication bypass vulnerability in the SFTP server module of goshs version 2.1.3 allows remote, unauthenticated attackers to read, write, modify, or delete files on the target hosting environment. This vulnerability is caused by an incomplete logic check during initialization that falls back to a password-less configuration when an empty password string is specified.

Vulnerability Overview

goshs is a single-binary, multi-protocol file server designed in Go for developer testing and offensive security operations. The server supports hosting file structures over HTTP, HTTPS, WebDAV, and SFTP. The utility's rapid deployment capability and rich feature set make it a common fixture in environments that require ad-hoc file transfers or staging capabilities.

A critical logic vulnerability exists in the SFTP server module within version 2.1.3. When the server is initialized using basic authentication but configured with an empty password string, the application fails to register any active authentication handler. The service is classified under CWE-306 (Missing Authentication for Critical Function).

The consequence of this registration failure is a complete exposure of the target system's exposed file structure. Because the underlying SSH handler defaults to an unsecured state when no validators are explicitly configured, remote, unauthenticated network entities can successfully establish full SFTP read, write, and deletion permissions. The vulnerability demands no privileged credentials and occurs transparently upon client connection.

Root Cause Analysis

The emergence of CVE-2026-62325 is directly linked to an incomplete resolution of its predecessor, CVE-2026-40884. In the prior vulnerability, configuring an empty username (e.g., -b ':password') led to a failed validation check, which left the initialization handlers empty. To remediate this, the developers added a validation check to sanity/checks.go that strictly blocks startup if the configuration string begins with a colon.

However, this sanitization logic only evaluated the prefix of the credential parameter, failing to inspect the trailing structure. As a result, starting the file server with a configuration like -b 'admin:' (valid username but empty password) is accepted by the validation layer. The system parses the configuration into the internal state variables, setting s.Username to "admin" and s.Password to "" (an empty string).

When initializing the SFTP backend inside sftpserver/sftpserver.go, the application executes the following check: if s.Username != "" && s.Password != "". Because s.Password is empty, the logical AND operation fails. Consequently, the program completely skips the registration of sshServer.PasswordHandler.

Because the administrator did not supply authorized keys via -fkf, the PublicKeyHandler also remains unassigned. Under the rules of the third-party SSH framework gliderlabs/ssh, if both authentication callbacks are unassigned, the platform falls back to enabling anonymous access via NoClientAuth = true. This implicit framework-level fallback is the direct source of the authentication bypass.

Code Analysis & Architectural Flow

The critical failure point resides in the conditional initialization logic inside sftpserver/sftpserver.go. The following visual model illustrates the progression from command-line parsing to the unsecured fallback state:

// Vulnerable Code Path: sftpserver/sftpserver.go
// If the password is empty, the block is completely skipped
if s.Username != "" && s.Password != "" {
    sshServer.PasswordHandler = func(ctx ssh.Context, password string) bool {
        return subtle.ConstantTimeCompare([]byte(ctx.User()), []byte(s.Username)) == 1 && subtle.ConstantTimeCompare([]byte(password), []byte(s.Password)) == 1
    }
}

In the patched version, the developer modified the logical operator from a conjunct (&&) to a disjunct (||). This modification guarantees that as long as at least one of the variables contains a string, the handler registers.

// Patched Code Path: sftpserver/sftpserver.go
// Changing to logical OR ensures the handler registers and enforces validation
if s.Username != "" || s.Password != "" {
    sshServer.PasswordHandler = func(ctx ssh.Context, password string) bool {
        return subtle.ConstantTimeCompare([]byte(ctx.User()), []byte(s.Username)) == 1 && subtle.ConstantTimeCompare([]byte(password), []byte(s.Password)) == 1
    }
}

Under this corrected construction, registering the handler prevents the underlying framework from falling back to NoClientAuth = true. A connecting client must now undergo password validation. For an empty-password configuration, the client must successfully supply an empty password to establish authorization, removing the unauthenticated bypass vector.

Exploitation Methodology

Exploitation of CVE-2026-62325 does not require deep memory corruption techniques or payload construction. To successfully execute the bypass, an attacker must identify an exposed goshs instance running version 2.1.3 where the administrator enabled SFTP but passed an empty password configuration.

The attacker initiates standard SSH transport negotiation. During the authentication handshake, the client queries the available authentication mechanisms. Because NoClientAuth is active, the server advertises none as a valid authentication technique.

The exploit script below demonstrates how a connection can be established without providing a password:

#!/usr/bin/env bash
set -euo pipefail
 
TARGET_HOST="127.0.0.1"
TARGET_PORT="2121"
 
echo "[*] Attempting unauthenticated connection to SFTP..."
 
# By enforcing 'none' authentication, we skip password entry entirely
sftp -o StrictHostKeyChecking=no \
     -o UserKnownHostsFile=/dev/null \
     -o PreferredAuthentications=none \
     -P "$TARGET_PORT" \
     "admin@$TARGET_HOST" << 'EOF'
ls -la
pwd
EOF

If the server is running in a vulnerable configuration, the directory index of the served directory is immediately returned. The attacker gains full read, write, and command-line execution access within the restricted scope of the file server's working directory.

Security Impact Assessment

The impact of this vulnerability is critical for exposed assets. An unauthenticated remote attacker can read every file present in the shared directory structure. In environments where goshs is deployed for administrative tasks or rapid sharing, this exposure can lead to the leaking of software source code, deployment variables, or personal developer credentials.

Because the SFTP server permits modifications, the impact on integrity is also severe. Attackers can upload files, overwrite executable files with malicious payloads, or delete critical resources. If the file server points to sensitive areas of a production host, an attacker can append public keys to local user .ssh/authorized_keys configurations to secure persistent system shells.

While the application does not allow general remote command execution on the host operating system directly through the SFTP interface, the arbitrary write capabilities make lateral escalation highly probable. If goshs runs under highly privileged system user contexts, the server compromise translates directly to a host compromise.

Mitigation & Remediation Guidance

To address this vulnerability, administrators must upgrade all deployed instances of goshs to version v2.1.4 or newer. The update alters the internal logical gates within the SFTP server code to ensure that a handler is consistently defined when partial credential structures are supplied.

If immediate upgrading is impossible, temporary mitigation requires checking running parameters. Administrators must audit operational scripts and ensure that no trailing colon is present inside the basic authentication configuration flag. For example, replacing -b 'admin:' with -b 'admin:strong_password' immediately forces the system to register the authentication block and eliminates the bypass vector.

For added security, organizations should use network security controls to limit file transfer utilities. Exposing goshs SFTP interfaces (typically port 2121) directly to external WAN IP addresses should be strictly prohibited. Using network address translations or localized VPN access reduces the attack surface and secures the service.

Official Patches

goshs-labsOfficial patch addressing authentication bypass logic in sftpserver.go
goshs-labsRelease notes and binaries for goshs version 2.1.4

Fix Analysis (1)

Technical Appendix

CVSS Score
9.1/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Affected Systems

goshsgithub.com/patrickhener/goshs/v2goshs.de/goshs/v2

Affected Versions Detail

Product
Affected Versions
Fixed Version
goshs
goshs-labs
>= 2.1.3, < 2.1.42.1.4
AttributeDetail
CWE IDCWE-306
Attack VectorNetwork
CVSS v3.1 Score9.1 (Critical)
Exploit StatusProof of Concept (PoC) Available
KEV StatusNot Listed
ImpactHigh (Confidentiality and Integrity)

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
CWE-306
Missing Authentication for Critical Function

The application fails to enforce authentication checks on operations requiring authorization, allowing remote users to run operations without credentials.

Known Exploits & Detection

GitHub Security AdvisoryFull advisory with architectural context, impact, mitigation steps, and proof-of-concept description.

Vulnerability Timeline

Disclosure of related empty-username bypass CVE-2026-40884
2026-04-13
Vulnerability analyzed and patch committed by developer Patrick Hener
2026-06-26
CVE-2026-62325 and GHSA-rjrw-mjq6-hpmm officially published
2026-07-28

References & Sources

  • [1]GitHub Security Advisory GHSA-rjrw-mjq6-hpmm
  • [2]Authentication Fix Commit
  • [3]goshs v2.1.4 Release
  • [4]goshs Project Repository
Related Vulnerabilities
CVE-2026-40884

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•26 minutes ago•CVE-2026-54654
7.8

CVE-2026-54654: Python Code Injection in datamodel-code-generator via Comment Line-Break Escape

A vulnerability in the datamodel-code-generator library allows for unauthenticated remote code execution when generating code from malicious or untrusted schema specifications. By embedding special physical line terminators, such as carriage returns, vertical tabs, or form feeds, within template values, an attacker can break out of inline Python comment boundaries. The generated output file subsequently contains un-commented python instructions that execute automatically during module import.

Amit Schendel
Amit Schendel
0 views•5 min read
•about 2 hours ago•CVE-2026-64863
9.1

CVE-2026-64863: WebDAV MOVE Bypass of --no-delete and --upload-only Restrictive Policies in goshs

An access control bypass vulnerability in goshs prior to version 2.1.4 allows unauthenticated remote attackers to bypass security flags intended to prevent file deletion and unauthorized modification. By exploiting the server's incorrect classification of WebDAV MOVE and overwriting COPY methods, attackers can execute arbitrary file deletion and data manipulation on the host system.

Amit Schendel
Amit Schendel
2 views•10 min read
•about 3 hours ago•CVE-2026-66063
6.5

CVE-2026-66063: Path Traversal Arbitrary File Write and Access Control Bypass in goshs

CVE-2026-66063 is an unauthenticated directory traversal and arbitrary file write vulnerability in goshs before version 2.1.5. Due to improper sanitization of file upload names, an unauthenticated attacker can write files outside the served web root. A related trailing slash bypass in the same version allows unauthorized file retrieval.

Alon Barad
Alon Barad
3 views•4 min read
•about 4 hours ago•CVE-2026-54638
7.5

CVE-2026-54638: Pre-Authentication Denial of Service via Unbounded Memory Allocation in gotd/td MTProto Parser

An unauthenticated remote Denial of Service (DoS) vulnerability exists in the plaintext message parsing implementation of gotd/td, a Go-based Telegram MTProto client and server library. The security flaw is located within the unencrypted message decoding pipeline, where the parser reads an untrusted length header and immediately performs a heap-based memory allocation without checking if the buffer contains the corresponding bytes. An attacker can exploit this behavior by sending a single crafted 20-byte packet containing an extremely large length value, leading to immediate memory exhaustion and process termination by the operating system Out-Of-Memory (OOM) killer.

Amit Schendel
Amit Schendel
3 views•7 min read
•about 5 hours ago•CVE-2026-54658
9.8

CVE-2026-54658: SQL Injection via Parameter Escaping Bypass in @hypequery/clickhouse

A critical SQL injection vulnerability was identified in @hypequery/clickhouse prior to version 2.0.2. The escapeValue utility function in packages/clickhouse/src/core/utils.ts fails to escape literal backslash characters before replacing single quotes. This allows remote, unauthenticated attackers to supply input parameters ending in a backslash, neutralizing the closing quote character inside ClickHouse databases and enabling arbitrary SQL execution.

Alon Barad
Alon Barad
6 views•5 min read
•about 6 hours ago•CVE-2026-54650
8.6

CVE-2026-54650: Remote Path Traversal in openhole-server and openhole CLI Client

A critical path traversal vulnerability (CWE-22) in openhole-server version 0.1.1 and earlier allows remote, unauthenticated attackers to traverse directories and access restricted files or endpoints on local backend services exposed via the tunnel proxy. The issue stems from improper handling of decoded URL paths inside the proxy handler, which are then reconstructed and executed literally by the CLI client.

Alon Barad
Alon Barad
7 views•5 min read