Summary
goshs, a Go-based SimpleHTTPServer, exposes file-based ACL credentials through its public collaborator feed when deployed without global basic authentication.
Because requests to .goshs-protected folders are logged and broadcast before authorization is enforced, an unauthenticated observer can capture and replay folder-specific Authorization headers to gain full access to the protected subtree.
Affected context
This vulnerability affects goshs deployments that:
- Run versions between 2.0.0-beta.4 and 2.0.0-beta.5
- Use .goshs-protected folders with folder-specific basic authentication
- Expose the collaborator websocket/feed to unauthenticated observers
- Do not enforce a global basic-auth gate in front of the entire server
In these conditions, request metadata for protected paths is logged and shared before access control checks complete.
Exploit preconditions
- Attack surface: Public collaborator websocket/feed and HTTP interface of goshs
- Required access: Network access to the goshs instance; no prior authentication needed when global basic auth is disabled
- Trigger point: A legitimate user accesses a .goshs-protected folder using basic auth; their request is logged
- Why exploitation is possible: The server logs and broadcasts raw request headers, including Authorization, before authorization decisions, allowing passive observers to capture reusable credentials
Why this happens
The core issue is a logging and broadcast design that treats sensitive request metadata as non-sensitive event data.
goshs records incoming HTTP requests to .goshs-protected folders and emits them over a collaborator websocket before enforcing authorization and without scrubbing confidential headers.
This aligns with CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where confidential data (here, basic-auth credentials) is unintentionally disclosed through diagnostic or collaboration channels due to insufficient separation between security-sensitive state and observability features.
Potential impact
- Unauthorized reading of files within .goshs-protected subtrees
- Uploading or overwriting files inside protected folders
- Deleting files in protected directories, potentially causing data loss
- Leveraging compromised credentials for further lateral movement within the same server context
- Undermining trust in folder-level access control configurations
General mitigation guidance
Effective mitigation generally centers on preventing sensitive data from being exposed via observability or collaboration features and reducing trust in reusable credentials:
- Ensure that logging and real-time feeds never include raw Authorization headers or other secrets; apply systematic header redaction
- Enforce authorization checks before emitting request-related events to any shared channel
- Treat collaborator or monitoring channels as potentially untrusted audiences and minimize the data shared through them
- Favor short-lived or scoped credentials for folder access to reduce the usefulness of any intercepted headers
- Apply a defense-in-depth model by placing stronger, centralized authentication (such as a global gate) in front of fine-grained ACLs where appropriate
How teams detect issues like this
Identifying this class of issue typically involves:
- Reviewing code paths where HTTP request metadata is logged or broadcast, and flagging any inclusion of Authorization or credential-like headers
- Using static analysis or custom linters to detect logging of security-sensitive headers or tokens
- Auditing websocket or event-stream implementations to ensure authorization checks happen before event emission and that events contain only minimally necessary data
- Implementing security-focused code review checklists that explicitly cover logging and observability channels for secret leakage
- Applying runtime monitoring to detect anomalous or repeated use of the same basic-auth headers from different clients or IP addresses

