CVE-2026-40884
Received Received - Intake
SFTP Authentication Bypass in goshs Allows Unauthenticated Access

Publication date: 2026-04-21

Last updated on: 2026-04-27

Assigner: GitHub, Inc.

Description
goshs is a SimpleHTTPServer written in Go. Prior to 2.0.0-beta.6, goshs contains an SFTP authentication bypass when the documented empty-username basic-auth syntax is used. If the server is started with -b ':pass' together with -sftp, goshs accepts that configuration but does not install any SFTP password handler. As a result, an unauthenticated network attacker can connect to the SFTP service and access files without a password. This vulnerability is fixed in 2.0.0-beta.6.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-04-21
Last Modified
2026-04-27
Generated
2026-05-07
AI Q&A
2026-04-21
EPSS Evaluated
2026-05-05
NVD
Affected Vendors & Products
Showing 6 associated CPEs
Vendor Product Version / Range
goshs goshs 2.0.0
goshs goshs to 2.0.0 (exc)
goshs goshs 2.0.0
goshs goshs 2.0.0
goshs goshs 2.0.0
goshs goshs 2.0.0
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-306 The product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

CVE-2026-40884 is a critical authentication bypass vulnerability in the Go-based SFTP server implementation called goshs, affecting versions up to v2.0.0-beta.5.

The issue occurs when the server is started using the documented empty-username basic authentication syntax with the command-line option '-b ':pass'' combined with the '-sftp' flag.

During startup, goshs parses the '-b' option by splitting on the colon, resulting in an empty username and a non-empty password. The server installs a password authentication handler only if both username and password are non-empty. Because the username is empty, no password handler is installed.

As a result, the SFTP server accepts connections without enforcing any password authentication, allowing unauthenticated attackers to connect and access files.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

This vulnerability allows unauthenticated remote attackers to bypass SFTP password authentication and access files without authorization. Such unauthorized access to sensitive data can lead to violations of data protection regulations and standards that require strict access controls and authentication mechanisms.

Specifically, regulations like GDPR and HIPAA mandate the protection of personal and sensitive information through proper authentication and access controls. The authentication bypass in goshs could result in unauthorized disclosure, modification, or deletion of protected data, thereby compromising confidentiality, integrity, and availability.

Therefore, organizations using vulnerable versions of goshs may fail to comply with these standards until the vulnerability is remediated.


How can this vulnerability impact me? :

This vulnerability allows unauthenticated remote attackers to bypass SFTP password authentication entirely.

Attackers can connect to the SFTP service without providing any credentials and perform unauthorized file operations such as reading, uploading, renaming, or deleting files within the configured SFTP root directory, depending on permissions.

The severity is critical with a CVSS v3.1 base score of 9.8, indicating high impact on confidentiality, integrity, and availability.


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability can be detected by checking if the goshs server is running with the vulnerable configuration where the -b option uses an empty username with a password (e.g., '-b ":pass"') combined with the -sftp flag.

A practical detection method is to attempt to connect to the SFTP service without providing any authentication credentials and verify if access is granted.

For example, if the server is running on port 2223, you can try connecting using an SFTP client without a password:

  • sftp -P 2223 user@hostname

If the connection succeeds and allows file operations without authentication, the server is vulnerable.

Additionally, reviewing the server startup command or configuration for the presence of '-b ":pass"' with the '-sftp' flag indicates the vulnerable setup.


What immediate steps should I take to mitigate this vulnerability?

Immediate mitigation steps include:

  • Avoid starting the goshs server with the '-b ":pass"' option when using the '-sftp' flag.
  • Upgrade goshs to version 2.0.0-beta.6 or later, where this vulnerability is fixed.
  • If upgrading is not immediately possible, configure the server to use a non-empty username with a password for basic authentication to ensure the password handler is installed.
  • Review and restrict network access to the SFTP service to trusted hosts until the vulnerability is remediated.

Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart