Back to skill

Security audit

testskill-0410repo123

Security checks for vulnerabilities and agentic risk

Overview

This skill is a QQ group administration helper, but it ships an overbroad authenticated OneBot dispatcher with a hardcoded token and an under-disclosed local-file-to-WebSocket data path.

Review before installing. Use only with a dedicated low-privilege OneBot instance and a rotated environment-provided token, remove the bundled fallback token, restrict the endpoint to a trusted local or approved wss:// server, and avoid allowing untrusted prompts or users to choose actions, parameters, or @/path file inputs.

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 (3)

T05 · Unauthorized Access and Privilege Escalation

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

Arbitrary Local File Disclosure Through Configurable WebSocket Endpoint

Content
View full analysis
[key=value ...]'); console.error('Special: key=@/path/to/file reads file content as value'); ``` ```js // Read from file: key=@/path/to/file if (val.startsWith('@/')) { const fs = require('fs'); val = fs.readFileSync(val.slice(1), 'utf8').trim(); } ``` ```js function callOneBot(action, params) { return new Promise((resolve, reject) => { const WebSocket = require('ws'); const echo = `${action}_${Date.now()}`; const url = WS_TOKEN ? `${WS_URL}?access_token=${encodeURIComponent(WS_TOKEN)}` : WS_URL; const ws = new WebSocket(url); const timeout = setTimeout(() => { ws.close(); reject(new Error(`Timeout waiting for response to ${action}`)); }, 15000); ws.on('open', () => { const payload = { action, params, echo }; ws.send(JSON.stringify(payload)); }); ``` ### Technical Analysis The argument parser treats any value beginning with `@/` as an absolute local file path and reads the file synchronously. The implementation applies no path allowlist, canonical-path validation, file-type restriction, size limit, or permission boundary beyond the operating-system privileges of the Node.js process. The resulting file contents are inserted into the `params` object and transmitted as JSON through a WebSocket connection. Because `ONEBOT_WS_URL` can override the destination, an invocation can combine arbitrary local-file reading with transmission to a remote, caller-selected WebSocket server. This behavior exceeds the documented group-administration purpose. `SKILL.md` does not describ ...[truncated 1288 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

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

Unrestricted Dispatch of Privileged OneBot Actions

Content
View full analysis
[key=value ...]'); console.error('Special: key=@/path/to/file reads file content as value'); process.exit(1); } const params = {}; for (let i = 3; i < argv.length; i++) { const arg = argv[i]; const eqIdx = arg.indexOf('='); if (eqIdx === -1) { console.error(`Invalid param format: ${arg} (expected key=value)`); process.exit(1); } let key = arg.slice(0, eqIdx).trim(); let val = arg.slice(eqIdx + 1).trim(); // Remove surrounding quotes if ((val.startsWith('"') && val.endsWith('"')) || (val.startsWith("'") && val.endsWith("'"))) { val = val.slice(1, -1); } // Read from file: key=@/path/to/file if (val.startsWith('@/')) { const fs = require('fs'); val = fs.readFileSync(val.slice(1), 'utf8').trim(); } // Auto-convert numeric values if (/^\d+$/.test(val)) val = parseInt(val, 10); params[key] = val; } return { action, params }; } ``` ```js function callOneBot(action, params) { return new Promise((resolve, reject) => { const WebSocket = require('ws'); const echo = `${action}_${Date.now()}`; const url = WS_TOKEN ? `${WS_URL}?access_token=${encodeURIComponent(WS_TOKEN)}` : WS_URL; const ws = new WebSocket(url); const timeout = setTimeout(() => { ws.close(); reject(new Error(`Timeout waiting for response to ${action}`)); }, 15000); ws.on('open', () => { const payload = { action, params, echo }; ws.send(JSON.stringify(payload)); }); ``` ```js const { action, params } = parseArgs(process.argv); ``` ### Technical Analysis The first command-line argument is acce ...[truncated 2177 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

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

Hard-Coded OneBot Credential and Insecure WebSocket Transport

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 (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented purpose is limited to QQ group administration, but the behavior indicates the underlying script can invoke arbitrary OneBot API actions and accept file/URL-like inputs. That creates a capability escalation risk: a caller expecting narrow admin actions may instead trigger private messaging, broader account/group queries, message deletion, or local-file-backed payload handling outside the declared scope.

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 documented as a QQ group-administration helper, but it actually accepts any caller-supplied OneBot action and forwards it directly to the backend. That mismatch can mislead users, reviewers, or higher-level agents into granting the tool broader authority than intended, enabling unintended actions beyond group admin scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script embeds a fallback WebSocket access token directly in code, so anyone with code access can recover a valid credential if the environment variable is absent. Hardcoded secrets are commonly leaked via repositories, logs, backups, or artifact distribution, and here they authorize privileged remote bot operations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code exposes a generic action dispatcher that forwards arbitrary API names and parameters to OneBot, which is broader than the skill’s declared group-management purpose. In an agent setting, this creates a powerful confused-deputy primitive: a user or prompt injection could invoke unrelated or sensitive bot APIs using the skill’s trusted connection and token.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill exposes environment-driven behavior 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 inherit sensitive runtime configuration implicitly, making it harder to constrain or audit what external service it connects to.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documented operations extend beyond the manifest description to include changing member cards/titles, setting group portrait, deleting messages, and reading group/member information. This scope creep increases the chance that an agent or reviewer will authorize the skill for one purpose while unintentionally granting broader moderation and information-access capabilities.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The script accepts any action name and sends it directly to the OneBot WebSocket API, including operations like group bans, renames, or notices shown in the examples. While the header states it can call arbitrary APIs, it does not clearly warn users that the tool can perform remote state-changing actions affecting groups or users without confirmation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The file's descriptive comments, usage text, and examples are written in Chinese only, which imposes a specific language without indicating that alternatives are available. Under the policy provided, language-specific presentation should offer user choice or clearly document a justified locale constraint.

Content

No source excerpt is available for this finding.