Summary
DevSpace's local UI server WebSocket accepted connections from any origin, unintentionally exposing internal UI endpoints to websites visited in the user's browser.
While the DevSpace UI is running, a malicious site can establish a cross-origin WebSocket connection to the local server on ws://127.0.0.1:8090 and interact with exposed functionality as if it were the user.
Affected context
The vulnerability occurs when a developer:
- Has the DevSpace UI server running on the local machine (default:
127.0.0.1:8090) - Accesses external websites in a browser while the local DevSpace UI is active
- Uses default or permissive DevSpace UI settings that do not restrict WebSocket origins
In this context, any website loaded in the developer's browser can attempt to connect to the local DevSpace WebSocket and call exposed endpoints.
Exploit preconditions
- Attack surface: The DevSpace UI WebSocket server bound to localhost (e.g.,
ws://127.0.0.1:8090) - Required access: Ability to lure the developer into visiting a malicious or compromised webpage in a standard browser on the same machine
- Trigger point: The browser's JavaScript code initiates a cross-origin WebSocket connection to the local DevSpace endpoint while the UI server is running
- Why exploitation is possible: The WebSocket implementation accepts connections from all origins by default and does not enforce strict origin or authentication checks for the exposed endpoints
Why this happens
This issue stems from a missing or insufficient origin validation and authentication layer on a locally exposed WebSocket API.
By accepting WebSocket connections from any origin, the DevSpace UI effectively treats browser-initiated traffic the same regardless of where it originates.
This aligns with:
- CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, because internal UI endpoints and associated data can be queried by untrusted sites.
- CWE-306: Missing Authentication for Critical Function, since the WebSocket endpoints do not require robust proof of identity or trust beyond the ability to reach the local port.
At an abstract level, the insecure pattern is exposing privileged local-control APIs via WebSockets without enforcing origin restrictions or strong authentication.
Potential impact
- Malicious websites may query DevSpace UI endpoints and obtain information about local projects, configurations, or Kubernetes contexts.
- Attackers could trigger DevSpace actions on behalf of the developer, such as starting, stopping, or modifying development workflows, depending on the exposed endpoints.
- Local development state and environment details can be inferred, potentially aiding further targeted attacks.
- Combined with other weaknesses or misconfigurations, this may contribute to broader compromise of the development environment.
General mitigation guidance
Risk reduction generally involves hardening local WebSocket endpoints and minimizing implicit trust in browser-originated traffic.
Common mitigation patterns include:
- Enforcing strict origin checking for WebSocket connections and maintaining an allowlist of trusted origins.
- Requiring explicit authentication or session tokens for any state-changing or sensitive WebSocket operation, even on localhost.
- Running local developer tools on randomized ports or behind an access control mechanism (e.g., a local proxy requiring credentials or tokens).
- Minimizing the exposure of powerful or sensitive actions over browser-accessible APIs and ensuring least-privilege for UI interactions.
- Providing secure-by-default configurations so that unsafe origin policies are never the default for developers.
How teams detect issues like this
Detection typically focuses on identifying permissive WebSocket policies and unguarded localhost APIs:
- Static analysis or code review to locate WebSocket server initialization that omits origin checks or uses wildcard origin policies.
- Configuration and policy reviews to ensure local tooling does not expose powerful APIs without authentication.
- Browser or network monitoring to detect unexpected cross-origin WebSocket connections to localhost ports used by development tools.
- Inclusion of automated checks in CI/QA pipelines that flag HTTP or WebSocket services with overly broad CORS/origin settings or missing auth on critical endpoints.

