T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/onebot-action.js:21- Finding
Unrestricted OneBot API Invocation Without an Action Allowlist
- Content
View full analysis
[key=value ...]'); console.error('Special: key=@/path/to/file reads file content as value'); process.exit(1); } ``` ```javascript ws.on('open', () => { const payload = { action, params, echo }; ws.send(JSON.stringify(payload)); }); ``` ### Technical Analysis The command-line `action` value is accepted verbatim and transmitted directly to the authenticated OneBot WebSocket endpoint. There is no allowlist restricting actions to the group-administration operations described in `SKILL.md`, no validation of the target group, and no confirmation or authorization mechanism for destructive operations. Consequently, this script is not limited to the documented functions. A caller able to invoke it can dispatch any action supported by the connected OneBot implementation, including undocumented or implementation-specific extension APIs. The exact available operations depend on the NapCat/OneBot server, but they may extend beyond group administration to messaging, account operations, request handling, or other bot capabilities. The skill documentation says that sensitive actions should be confirmed, but this requirement is not enforced by code. Documentation-only guidance does not provide a security boundary. ### Attack Path 1. An attacker influences an agent prompt, automation input, or other caller that can execute this skill. 2. The attacker supplies an arbitrary action name instead of one of the documented group-management actions. 3. The attacker supplies any parameters required by that action. 4. The script connects using the configured OneBot credential. 5. It forwards ...[truncated 996 chars]- Remediation
View remediation
