Back to skill

Security audit

Kaiwu Search

Security checks for vulnerabilities and agentic risk

Overview

This is a real search skill, but it can automatically use a wallet signature to register for an API key without clear user consent.

Install only if you are comfortable sending searches to kaiwu.dev. Configure KAIWU_API_KEY manually if possible, and do not allow the agent to auto-register or sign with a wallet unless you have reviewed the full SIWE message and intentionally approve it.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:13
Finding
Automatic Wallet Discovery and SIWE Signing Exceed Search-Skill Privileges## Vulnerability Details **File Location**: `SKILL.md:13-16` and duplicated in `kaiwu-search/SKILL.md:13-16` **Vulnerability Type**: `T05: Unauthorized Access and Privilege Escalation` **Risk Level**: Medium **Complete Vulnerable Code Snippet**: ```markdown Requires `KAIWU_API_KEY` secret. If not set: 1. Check if agent has a wallet (base-wallet skill or existing wallet). 2. If wallet exists: auto-register via `POST https://kaiwu.dev/api/auth/agent-register` with SIWE signature to get a key. 3. If no wallet: instruct user to visit `https://kaiwu.dev` to get a free API key (1,000 searches/month free). ``` ### Technical Analysis The Skill's stated function is web search, which only requires an API credential and outbound access to the declared search endpoint. However, when the API key is unavailable, the instructions direct the Agent to discover whether a wallet is present and automatically create a Sign-In with Ethereum signature for an external service. Wallet discovery and cryptographic signing cross a sensitive privilege boundary that is not necessary for performing web searches. The instructions do not require explicit user authorization immediately before signing and do not define or validate the complete SIWE message. In particular, they provide no requirements for validating the expected domain, URI, chain ID, nonce, issued-at time, expiration time, or human-readable statement. SIWE signatures are normally authentication proofs rather than blockchain transactions, and the reviewed files do not instruct the Agent to disclose private keys or transfer funds. Nevertheless, automatically signing an insufficiently specified message allows the external registration process to obtain a cryptographic proof tied to the user's wallet identity. If the remote service or registration flow is compromised or deceptive, the Agent could be induced to sign content whose scope the user has not reviewed. The same instruction appears in bot ...[truncated 2039 chars]
Remediation
## Remediation Suggestions 1. Remove automatic wallet discovery and wallet signing from the API-key setup procedure. 2. Require users to configure `KAIWU_API_KEY` manually through an approved secret-management mechanism. 3. If wallet-based registration remains available, make it explicitly optional and require informed user approval immediately before every signature. 4. Display the complete SIWE message to the user before signing, without truncation or hidden fields. 5. Strictly validate all SIWE fields against fixed expectations: - Domain and URI must exactly match the trusted service. - Chain ID must be explicitly allowed. - Nonce must be unique, unpredictable, and single-use. - Issued-at and expiration times must enforce a short validity period. - The statement must clearly explain that the signature is only for API registration. - Resources and request identifiers must be rejected unless explicitly expected. 6. Never sign opaque hashes, arbitrary messages, typed data, or transaction payloads as part of API registration. 7. Ensure registration signatures cannot be reused for unrelated authentication or authorization. 8. Document what wallet information is transmitted, how it is retained, and how users can revoke the resulting API credential. 9. Apply the remediation consistently to both `SKILL.md` and `kaiwu-search/SKILL.md` to prevent conflicting or stale instructions.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Vague Triggers

Medium
Confidence
92% confidence
Finding
The trigger and description are broad enough to cause this skill to activate for generic search or research requests, potentially overriding safer or more appropriate tools. Because the skill performs external web queries and may initiate follow-on setup behavior, unintended invocation increases the chance of unnecessary data disclosure and user surprise.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The setup instructions state that if no API key is present, the agent may automatically register with an external service using a wallet and SIWE signature, but there is no prominent warning or consent requirement. This can lead to transmission of wallet-linked identity material and account creation with a third party without the user's informed approval.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The trigger description is overly broad, including generic phrases like "web search," "research in Chinese," and broad topical cues such as Taiwan/China/East Asia. This can cause the skill to activate in situations the user did not clearly request, increasing the chance that queries and context are sent to an external service without sufficiently specific user intent.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The setup instructions state that if no API key is present, the agent should automatically register with kaiwu.dev using a wallet and SIWE signature, but they do not include an explicit warning or consent requirement. This is dangerous because it can transmit wallet-linked identity and signature material to a third party and create an external account without the user's informed approval.

External Transmission

Medium
Category
Data Exfiltration
Content
## Search

```bash
curl -X POST https://kaiwu.dev/v1/search \
  -H "Authorization: Bearer $KAIWU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
## Search

```bash
curl -X POST https://kaiwu.dev/v1/search \
  -H "Authorization: Bearer $KAIWU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.