Back to skill

Security audit

OneBot Adapter

Security checks for vulnerabilities and agentic risk

Overview

This QQ/OneBot adapter is mostly coherent, but it exposes moderation actions and private message data in ways users should review carefully before installing.

Install only if you are comfortable giving the skill access to your configured OneBot server and bot account. Before production use, restrict the token and endpoint to trusted hosts, prefer TLS for remote connections, disable or redact verbose event logging, and add explicit authorization and confirmation around message deletion, kicks, bans, and group-setting changes.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/onebot_ws_listener.py:81
Finding

Unredacted OneBot Events Expose Message and Identity Data in Logs

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/onebot_client.py:25
Finding

Configurable Plaintext Transports Can Expose OneBot Tokens and Message Traffic

Content
View full analysis
Dict[str, Any]: """Make HTTP request to OneBot API""" url = f"{self.base_url}{endpoint}" try: if method == "GET": resp = requests.get(url, headers=self.headers, timeout=10) else: resp = requests.post(url, headers=self.headers, json=data, timeout=10) ``` The WebSocket listener behaves similarly: ```python self.ws_url = ws_url or os.getenv("ONEBOT_WS_URL", "ws://127.0.0.1:3001") self.token = token or os.getenv("ONEBOT_TOKEN", "") ``` ```python headers = {} if self.token: headers["Authorization"] = f"Bearer {self.token}" while self.running: try: print(f"Connecting to {self.ws_url}...") async with websockets.connect(self.ws_url, extra_headers=headers) as ws: ``` The documented configuration uses plaintext URL schemes: ```bash export ONEBOT_WS_URL="ws://127.0.0.1:3001" export ONEBOT_HTTP_URL="http://127.0.0.1:3000" export ONEBOT_TOKEN="your-token" ``` ### Technical Analysis The loopback defaults reduce exposure when the OneBot server runs on the same trusted host. Nevertheless, both connection URLs are configurable and the implementation accepts remote `http://` and `ws://` endpoints without rejection or warning. When a bea ...[truncated 1662 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/onebot_ws_listener.py:45
Finding

Incorrect Handler Registration Processes Group Messages as Private Messages

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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description frames the skill as a message send/receive adapter, but the referenced client capabilities imply substantially broader powers including enumerating contacts/groups and performing destructive or administrative actions such as recalls, kicks, bans, and renames. This mismatch is dangerous because downstream users or agents may grant or invoke the skill under the assumption of low-risk messaging behavior while it can actually perform moderation and information-gathering operations on QQ/OneBot targets.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill documents network access and use of environment variables for connection endpoints and tokens, but it does not declare any explicit tool scope or permissions. This creates a capability transparency problem: an agent or reviewer may invoke the skill without realizing it can access sensitive configuration and communicate with external/local services, increasing the chance of unintended data exposure or unauthorized actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file includes a group-management example that removes a user from a group via client.set_group_kick(group_id, user_id) without any accompanying warning, confirmation, or note that the action is administrative and disruptive. For markdown files, examples that can affect user access or system integrity should disclose such behavior so users understand the consequence before adopting the pattern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code performs outbound HTTP requests and can transmit message content, group identifiers, and user identifiers to a configured OneBot endpoint. While there are internal docstrings, there is no user-facing confirmation, log message, or warning in this file indicating that data will be sent over the network.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/onebot_client.py (reported line 39)May include surrounding context.

python
if method == "GET":
                resp = requests.get(url, headers=self.headers, timeout=10)
            else:
                resp = requests.post(url, headers=self.headers, json=data, timeout=10)
            
            resp.raise_for_status()
            return resp.json()

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is described as QQ message integration, but this client also exposes administrative operations such as kicking users, banning users, and changing group metadata. In an agent-skill context, capability expansion beyond the stated purpose increases the risk of unintended or unauthorized destructive actions if the skill is invoked with untrusted inputs or granted broad access.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Group moderation and configuration functions are not necessary for simple send/receive QQ integration, so their presence violates least privilege for the advertised purpose. In an autonomous agent environment, these extra functions could be abused to remove users, mute members, or rename groups without operator awareness.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The listener logs the full incoming OneBot event payload, which can include message bodies, user IDs, group IDs, and other metadata. In a QQ/OneBot integration context this is sensitive user data, and printing it to stdout can expose private conversations or identifiers through console output, process supervisors, centralized logs, or shared hosting environments.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The keyword-response example activates on the Chinese term 帮助 and returns a Chinese response, which imposes a specific language behavior without any opt-in or note that the example is locale-specific. This can violate language/locale policy when a skill implicitly assumes one language instead of offering a choice or documenting the constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The client reads ONEBOT_TOKEN from the environment and automatically attaches it as a Bearer token to outbound requests. Although this is a normal implementation pattern, the file does not provide any user-facing notice that credentials are being read from environment variables and transmitted to the remote service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This code accesses a sensitive credential source via an environment variable to authenticate WebSocket connections. While this is a normal implementation pattern, the file does not include any comment or docstring warning that credentials are consumed from the environment.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.