Summary
Microsoft UFO's WebSocket control plane incorrectly trusts identity and role fields supplied inside task messages instead of enforcing the role bound to the underlying WebSocket session.
Any client holding the shared server token can spoof a higher-privilege constellation role, overwrite another client's registration, and dispatch attacker-controlled tasks to victim devices.
Affected context
This vulnerability affects deployments of the Microsoft UFO open-source framework where devices and controller components connect to a central WebSocket control plane using a shared server token.
The issue occurs in UFO versions around 3.0.1-4-ge2626659 when:
- WebSocket clients self-identify their role (e.g., device vs. constellation) via message fields, and
- The server accepts those in-message identity/role claims for authorization decisions instead of relying solely on the connection's established role and identity.
Environments with multiple devices and higher-privilege "constellation" orchestrators are most exposed, as any authenticated client can impersonate those orchestrators toward other devices.
Exploit preconditions
- Attack surface: WebSocket control plane endpoint used by UFO devices and constellation nodes.
- Required access:
- Ability to establish an authenticated WebSocket connection using the shared server token.
- Ability to send crafted TASK and registration messages over that connection.
- Trigger points:
- Sending a TASK message that claims
client_type="constellation"and setstarget_idto another active device's identifier. - Registering using a
client_idthat is already in use, causing the registry to overwrite the existing client's stored WebSocket, role, and task protocol. - Why exploitation is possible:
- The server trusts identity and role fields from each wire message, rather than binding authorization decisions to the authenticated WebSocket session state.
- The client registry does not prevent duplicate
client_idregistrations or treat them as suspicious, allowing one client to take over another client's logical identity.
Why this happens
The core issue is a mismatch between authentication and authorization boundaries.
Instead of treating the WebSocket connection as the authoritative identity/role anchor, the control plane reads client_type, target_id, and related identity fields from every incoming task message and uses them directly for authorization and routing.
This pattern aligns with CWE-290 (Authentication Bypass by Spoofing) and CWE-639 (Authorization Bypass Through User-Controlled Key): security-critical attributes (role, target identity) are accepted from untrusted client input without binding them to the authenticated context.
Additionally, the ability to re-register an existing client_id without conflict checks reflects missing authorization and state integrity controls, consistent with CWE-862 (Missing Authorization) when mutating registry entries that represent other live clients.
Abstractly, the bug is "trusting client-supplied identity/role metadata per message instead of enforcing a server-side session model and uniqueness constraints for identities."
Potential impact
- An authenticated but low-privilege device client may spoof the high-privilege constellation role.
- Attackers can dispatch arbitrary tasks or workflows to other connected devices by setting
target_idto a victim's identifier. - Existing active clients can have their registry entries overwritten, causing their WebSocket, role, and task protocol to be hijacked.
- Compromised or malicious clients can orchestrate cross-device abuse, such as coordinated misconfiguration, data manipulation, or denial of service actions.
- Downstream automation flows that trust constellation-issued tasks may execute attacker-controlled actions on edge devices or services.
General mitigation guidance
Administrators and developers can reduce risk by restructuring trust boundaries and authorization flows:
- Bind identity and role to the WebSocket session: Treat authentication as establishing a fixed identity/role for the lifetime of the connection; do not accept role changes or identity claims from normal task messages.
- Ignore client-supplied role fields for authorization: Server-side logic should compute the effective role from the authenticated connection context, not from wire-level
client_typeor similar fields. - Enforce strict identity uniqueness and ownership: Ensure
client_idvalues are unique per active session; prevent one client from overwriting another's registry entry without explicit, authenticated ownership checks. - Introduce explicit re-authentication for role changes: If role upgrades or mode changes are required, gate them behind dedicated, strongly authenticated flows and additional policy checks rather than ad-hoc message fields.
- Apply least-privilege design to control-plane tokens: Avoid shared tokens where possible; use per-device or per-role credentials to limit blast radius if a client is compromised.
- Harden protocol semantics: Design task and control messages so that sensitive routing attributes (e.g., source role, allowed targets) are derived server-side and minimally influenced by client-controlled data.
How teams detect issues like this
Teams can look for this vulnerability pattern and its symptoms through a mix of code- and behavior-based approaches:
- Code review and design inspection:
- Identify places where authorization decisions depend on message fields like
client_type,role,target_id, orclient_idinstead of authenticated session state. - Flag registry operations that update or replace client entries without verifying ownership or connection identity.
- Static analysis rules:
- Create rules that detect uses of user-controlled identity or role parameters in authorization checks or routing logic.
- Scan for control-plane handlers that accept arbitrary
client_idrebinding without corresponding authorization checks. - Runtime monitoring and logging:
- Log role claims and target identifiers from TASK messages, correlating them with the authenticated connection's known role and identity.
- Alert on inconsistencies, such as a device-registered connection sending messages marked as
constellation, or frequent re-registrations of the sameclient_idfrom different origins. - Security testing and fuzzing:
- Exercise the WebSocket control plane with crafted messages that manipulate identity and role fields to validate that the server rejects unauthorized role escalation and client identity collisions.
- Automated policy enforcement:
- Integrate CI/CD checks that require explicit mapping from authentication layer (tokens, certificates) to authorization decisions, and block changes that reintroduce message-level trust in identity fields.

