Summary
goshs versions before 2.1.0 do not apply read-only, upload-only, and no-delete restrictions to the WebDAV listener. An authenticated WebDAV client may therefore perform file-management operations that the operator intended to prevent when WebDAV is enabled.
Affected context
The issue occurs in goshs deployments that enable WebDAV with the -w option while relying on mode-restriction flags such as --read-only, --upload-only, or --no-delete. Those restrictions are applied on the primary HTTP port but may not carry over to the separate WebDAV handler, creating inconsistent authorization behavior across service interfaces.
Exploit preconditions
- Attack surface: The WebDAV listener exposed by goshs
- Required access: Valid authentication to the WebDAV service
- Trigger point: A file-management request handled by the WebDAV port
- Why exploitation is possible: The WebDAV handler accepts operations without applying the restrictions configured for the primary HTTP service
Why this happens
The vulnerability results from inconsistent authorization enforcement between two service interfaces. The primary HTTP endpoint evaluates mode restrictions, while the WebDAV endpoint is connected directly to a generic WebDAV handler without equivalent policy checks. This maps to CWE-284, Improper Access Control, because authenticated users can perform actions outside the operator-defined authorization policy.
Potential impact
- An authenticated client may upload files despite read-only settings.
- An authenticated client may delete files when deletion is intended to be disabled.
- Files or directories may be created, moved, or copied without authorization.
- Hosted content could be altered, removed, or replaced.
- The service may experience data integrity or availability impacts.
General mitigation guidance
Mitigation generally focuses on enforcing the same authorization policy at
every exposed protocol and handler.
Common defensive patterns include:
- Applying read, write, upload, and deletion controls directly within the WebDAV request path.
- Using secure-by-default configurations that deny write operations unless explicitly enabled.
- Reducing trust in client-supplied operation requests by validating each method against server policy.
- Restricting WebDAV exposure to trusted networks or authenticated principals with the minimum required privileges.
- Separating read-only and writable service instances when distinct policy boundaries are needed.
How teams detect issues like this
Organizations can identify similar issues through:
- Static analysis and code review of all protocol handlers for consistent authorization checks.
- Tests that exercise every configured access mode through both HTTP and WebDAV interfaces.
- Review signals showing a generic handler is mounted without shared policy middleware.
- Runtime logging and alerting for unexpected PUT, DELETE, MKCOL, MOVE, and COPY requests.
- Policy enforcement requiring authorization tests for each exposed endpoint and HTTP method.
Automated code review tools may help flag handler paths that bypass centralized access-control logic.

