T09 · Insecure Skill Coding Practices
- Location
SKILL.md:153- Finding
Bearer Token Exposed Through WebSocket Query String
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 153–159
Vulnerability Type: Bearer credential exposure through a URL query parameter
Risk Level: MediumVulnerable Code:
text ## WebSocket news_wss Protocol Connect with the token in the query string: ```text wss://ai.6551.io/open/news_wss?token=$OPENNEWS_TOKENtext ### Technical Analysis The Skill directs the agent to place the reusable `OPENNEWS_TOKEN` in the WebSocket URL query string. WSS protects the connection while data is in transit, but it does not prevent the URL from being recorded by client diagnostics, proxy logs, access logs, monitoring systems, shell history, exception reports, or debugging output. Query parameters are less appropriate for bearer credentials than authorization headers because URLs routinely pass through logging and observability systems. The behavior is necessary only if the remote WebSocket API exclusively supports query-string authentication; transmitting the long-lived token in this form is not otherwise the minimum-risk method required for the declared news-streaming functionality. ### Attack Path 1. The agent expands `$OPENNEWS_TOKEN` while constructing the WebSocket URL. 2. A client, proxy, monitoring service, diagnostic facility, or execution log records the full URL. 3. An attacker with access to that record extracts the `token` query parameter. 4. The attacker replays the bearer token against the OpenNews authenticated endpoints or WebSocket service. 5. Until the token expires or is revoked, the attacker can exercise the permissions and quota associated with the affected account. ### Impact Assessment Successful exploitation could allow unauthorized access to authenticated OpenNews functions, consumption of the victim's API quota, retrieval of account-specific strategy configuration or strategy-triggered events, and subscription to authenticated news streams. The obtained privilege is limi ...[truncated 128 chars]- Remediation
View remediation
Remediation Suggestions
- Modify the WebSocket service and examples to authenticate the handshake with an
Authorization: Bearerheader where client support permits it. - If header authentication is unavailable, exchange the bearer token through an authenticated HTTPS request for a short-lived, single-use WebSocket ticket.
- Ensure WebSocket tickets have a narrow scope, brief expiration period, and replay protection.
- Explicitly prohibit printing or logging token-bearing URLs.
- Configure clients, reverse proxies, telemetry platforms, and error-reporting systems to redact the
tokenquery parameter. - Document immediate token revocation and rotation procedures for suspected exposure.
- Avoid placing the expanded URL in shell history or diagnostic output.
- Modify the WebSocket service and examples to authenticate the handshake with an
