Back to skill

Security audit

onebot QQ群管理

Security checks for vulnerabilities and agentic risk

Overview

This QQ group admin skill exposes broader bot-control and local-file-reading capability than its user-facing purpose clearly scopes.

Review before installing. Only use this skill in a tightly controlled local environment with a dedicated low-privilege bot account, rotate the embedded OneBot token, remove the hardcoded fallback, restrict actions and groups with an allowlist, and remove the arbitrary '@/path' file-read feature before trusting it with real QQ groups or local secrets.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T05 · Unauthorized Access and Privilege Escalation

Error
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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/onebot-action.js:43
Finding

Arbitrary Local File Read and Disclosure Through OneBot Parameters

Content
View full analysis
{ const payload = { action, params, echo }; ws.send(JSON.stringify(payload)); }); ``` ### Technical Analysis Any parameter value beginning with `@/` is interpreted as an absolute filesystem path. The script reads that file synchronously with the privileges of the Node.js process and substitutes its entire contents into the outgoing OneBot request. There is no path allowlist, base-directory restriction, file-type validation, size limit, symbolic-link defense, or check that the selected action legitimately needs file content. Because the action is also unrestricted, a caller can combine the file-read feature with an API action that publishes or transmits text. Alternatively, if `ONEBOT_WS_URL` points to an attacker-controlled WebSocket endpoint, the request itself discloses the file content to that endpoint. The help text exposes the feature, but `SKILL.md` does not document its security implications. The capability is unnecessary for most documented group-administration operations. ### Attack Path One viable attack path is: 1. The attacker gains influence over arguments passed to the script. 2. The attacker selects a readable sensitive file using a parameter such as `content=@/path/to/sensitive-file`. 3. `readFileSync()` reads the file under the privileges of the process running the skill. 4. The file contents replace the original parameter value. 5. The script serializes those contents into the OneBot payload. 6. The contents are disclosed either: - to the configured WebSocket server directly; or - through a supported OneB ...[truncated 911 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/onebot-action.js:18
Finding

Hardcoded OneBot Authentication Token Exposed in Source Code

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/onebot-action.js:18
Finding

OneBot Credential and API Traffic Can Be Sent Over Unencrypted WebSocket Connections

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented purpose is limited to QQ group administration, but the skill behavior reportedly supports arbitrary OneBot API invocation and file/URL-backed parameters such as set_group_portrait file=..., which materially expands its reachable capability. In practice this can enable actions beyond group admin scope, including other account, friend, message, or bot operations, and can expose local file content or trigger unintended network access through the OneBot service while using authenticated WebSocket access not clearly disclosed in the description.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 17)May include surrounding context.

md
通过 `scripts/onebot-action.js` 调用 napcat 的 OneBot 11 API 执行群管理操作。

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script is presented as a QQ group-management utility, but it accepts any caller-supplied action and forwards it directly to the OneBot WebSocket API. This creates a capability mismatch: any workflow or agent that trusts the skill’s stated scope can be tricked into invoking broader OneBot operations than intended, potentially including sensitive bot, friend, group, or system-affecting APIs.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill exposes environment-derived capabilities via ONEBOT_WS_URL and ONEBOT_WS_TOKEN but does not declare any tool scope or permissions boundary. This weakens reviewability and allows the skill to authenticate to a local OneBot service with operator credentials without that privileged access being explicitly surfaced to users or policy controls.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The tool allows potentially destructive administrative actions to be executed immediately based only on command-line input, with no confirmation gate, policy check, or role restriction. In the skill context, this is more dangerous because group-management actions like bans, kicks, admin changes, or announcements can cause immediate operational harm if triggered accidentally, by prompt injection, or by a confused agent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The '@/path/to/file' feature lets a caller read arbitrary local files and inject their contents into API parameters, which can then be transmitted over the WebSocket connection. In an agent setting, this is a local file disclosure primitive unrelated to normal group management and could expose secrets such as tokens, configs, SSH keys, or application data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file-reading shortcut silently converts user input into local file access and sends the resulting contents to the remote OneBot endpoint without any explicit warning at the point of use. In an agent or automation environment, this materially increases the risk of covert exfiltration because a seemingly ordinary parameter can become a secret-bearing payload.

Content

No source excerpt is available for this finding.