Skip to content

Security: WebSocket authentication token exposed in URL query string#1327

Open
tomaioo wants to merge 1 commit into
gnmyt:mainfrom
tomaioo:fix/security/websocket-authentication-token-exposed-i
Open

Security: WebSocket authentication token exposed in URL query string#1327
tomaioo wants to merge 1 commit into
gnmyt:mainfrom
tomaioo:fix/security/websocket-authentication-token-exposed-i

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented Apr 12, 2026

Summary

Security: WebSocket authentication token exposed in URL query string

Problem

Severity: High | File: client/src/common/hooks/useStateStream.js:L22

The state-stream WebSocket URL includes sessionToken as a query parameter. Query-string tokens are commonly logged by reverse proxies, load balancers, browser/network tooling, and server access logs, increasing credential exposure risk. If leaked, this token can be replayed to hijack sessions.

Solution

Avoid placing long-lived auth tokens in URLs. Use secure HttpOnly cookies for WebSocket auth, or exchange the session token for a short-lived, single-use WS token before connecting. Ensure server-side logs redact sensitive query parameters if unavoidable.

Changes

  • client/src/common/hooks/useStateStream.js (modified)

The state-stream WebSocket URL includes `sessionToken` as a query parameter. Query-string tokens are commonly logged by reverse proxies, load balancers, browser/network tooling, and server access logs, increasing credential exposure risk. If leaked, this token can be replayed to hijack sessions.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant