Back to skill

Security audit

Call Aida App

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says by calling an AIDA API, but it handles bearer tokens and user-provided content in ways users should review carefully before installing.

Install only if you intend to send the provided inputs, query, user identifier, and bearer-token appid to the AIDA service. Prefer stdin or a managed secret store over command-line arguments or exported environment variables, avoid putting real tokens in shell history or logs, and do not run the bundled tests with real credentials or sensitive fixtures unless you explicitly want live requests to the production endpoint.

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

T09 · Insecure Skill Coding Practices

Warning
Location
call_aida_app.py:42
Finding
Bearer token may be exposed through command-line arguments and environment variables<![CDATA[ ## Vulnerability Details **File Location**: `call_aida_app.py:42-58` **Additional Locations**: `SKILL.md:21-29`, `README.zh.md:17-32`, `EXAMPLES.md:57-67` **Vulnerability Type**: Insecure credential handling **Risk Level**: Medium ### Vulnerable Code ```python parser = argparse.ArgumentParser(description="调用 AI 搭 chat-messages 接口") parser.add_argument("--appid", help="AI 搭 appid (Bearer Token)") parser.add_argument("--query", default="", help="用户 query,可选") parser.add_argument("--inputs", help="inputs JSON 字符串") parser.add_argument("--user", default="openclaw", help="用户标识") args = parser.parse_args() if args.appid and args.inputs: try: inputs = json.loads(args.inputs) if isinstance(args.inputs, str) else args.inputs return args.appid, args.query, inputs except json.JSONDecodeError: pass # 3. 环境变量 appid = os.environ.get("AIDA_APPID") query = os.environ.get("AIDA_QUERY", "") inputs_str = os.environ.get("AIDA_INPUTS") ``` The documentation actively recommends command-line token submission: ```bash python3 main.py --appid <用户提供的appid> --query "<用户提供的query>" --inputs '<用户提供的inputs的JSON字符串>' ``` It also recommends exporting the token into the process environment: ```bash export AIDA_APPID="your-app-id" export AIDA_INPUTS='{"key": "value"}' export AIDA_QUERY="optional query" export AIDA_USER="your-username" ``` ### Technical Analysis The project identifies `appid` as a bearer token but supports and documents passing it as a command-line argument. Command-line arguments can be retained in shell history and may be visible through process inspection, CI job logs, terminal recording, monitoring agents, or diagnostic reports. Environment variables are safer than command-line arguments in some environments but remain vulnerable to inheritance by child processes, accidental diagnostic dumps, CI configuration exposure, and access by sufficiently privileged local processes. Several stdin examples use `echo` with the toke ...[truncated 1620 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove bearer-token values from command-line examples and discourage use of `--appid` for production credentials. 2. Prefer integration with an operating-system keychain, CI secret manager, or dedicated secrets-management service. 3. Support reading the token from a permission-restricted file, inherited file descriptor, or interactive hidden prompt. 4. If environment-variable support is retained: - Clearly document its exposure and inheritance risks. - Avoid printing the environment in diagnostics. - Unset the variable immediately after loading it where practical. - Prevent child processes from inheriting it unnecessarily. 5. Do not embed real tokens in `echo` commands. Provide an interactive or protected-file stdin example instead. 6. Ensure logging, exception handling, and telemetry never include the `Authorization` header or raw token. 7. Recommend narrowly scoped and short-lived tokens, with rotation and revocation procedures. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
test.sh:82
Finding
Local test suite performs unmocked requests to the production AIDA endpoint<![CDATA[ ## Vulnerability Details **File Location**: `test.sh:82-84` **Additional Locations**: `test.sh:98-106`, `test.sh:120`, `call_aida_app.py:89-102` **Vulnerability Type**: Unexpected external network activity during testing **Risk Level**: Low ### Vulnerable Code The test described as a simulated stdin invocation executes the production client directly: ```bash # Test 4: 通过 stdin 传入参数(模拟调用) test_case "通过 stdin 传入参数" \ "echo '{\"appid\":\"test\",\"inputs\":{}}' | python3 $SCRIPT_PATH 2>&1" \ "success" ``` Additional tests also invoke the production client with sufficient parameters to reach its network request: ```bash # Test 7: 完整的命令行参数 test_case "完整命令行参数" \ "python3 $SCRIPT_PATH --appid 'test' --inputs '{}' 2>&1" \ "success" # Test 8: 带 query 参数 test_case "带 query 参数" \ "python3 $SCRIPT_PATH --appid 'test' --inputs '{}' --query 'test' 2>&1" \ "success" # Test 9: 环境变量方式 test_case "环境变量方式" \ "AIDA_APPID='test' AIDA_INPUTS='{}' python3 $SCRIPT_PATH 2>&1" \ "success" ``` The output-format test performs another live invocation: ```bash output=$(python3 $SCRIPT_PATH --appid 'test' --inputs '{}' 2>&1) ``` The production client contains no test-mode interception: ```python try: with urllib.request.urlopen(req, timeout=120) as resp: data = json.loads(resp.read().decode("utf-8")) ``` ### Technical Analysis The tests do not mock `urllib.request.urlopen`, redirect the client to a local test server, or require explicit authorization for integration testing. Consequently, several tests that appear to validate argument parsing or JSON output make real HTTPS requests to: ```text https://aida.vip.sankuai.com/v1/chat-messages ``` Using the placeholder token `test` limits the likely sensitivity of the bundled test cases, but the behavior remains unnecessary for local syntax, argument-parsing, and output-format checks. It also makes tests dependent on external availability and can produce avoidable traffic again ...[truncated 1316 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Mock `urllib.request.urlopen` for unit tests so argument parsing, request construction, error handling, and output formatting can be tested without network access. 2. Move real API checks into a separate integration-test script. 3. Require an explicit opt-in environment variable, such as `RUN_AIDA_INTEGRATION_TESTS=1`, before any live request. 4. Require integration-test credentials to come from a managed secret store rather than source files or command-line arguments. 5. Clearly print a warning before integration tests contact the external endpoint. 6. Consider making the API endpoint injectable for testing, while enforcing an approved-host allowlist in production mode. 7. Use a local HTTP test server or mocked response fixtures for success, HTTP error, timeout, malformed JSON, and missing-`answer` scenarios. 8. Add a test that fails if ordinary unit tests attempt any external network connection. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (25)

Tainted flow: 'req' from os.environ.get (line 91, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
)

    try:
        with urllib.request.urlopen(req, timeout=120) as resp:
            data = json.loads(resp.read().decode("utf-8"))

        # 检查是否有 answer 字段
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
if [ -L "$LINKS_DIR/$SKILL_NAME" ]; then
        echo "移除现有符号链接..."
        rm "$LINKS_DIR/$SKILL_NAME"
    fi

    ln -s "$SKILL_DIR" "$LINKS_DIR/$SKILL_NAME"
Confidence
95% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Skill Enumeration

Medium
Category
Agent Snooping
Content
### 📖 完整文档(20分钟)
**文件:** `SKILL.md`
```bash
cat ~/.openclaw/skills/call-aida-app/SKILL.md
```
详细的 API 文档、参数说明和完整功能描述。
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Skill Enumeration

Medium
Category
Agent Snooping
Content
### 📖 完整文档(20分钟)
**文件:** `SKILL.md`
```bash
cat ~/.openclaw/skills/call-aida-app/SKILL.md
```
详细的 API 文档、参数说明和完整功能描述。
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Skill Enumeration

Medium
Category
Agent Snooping
Content
### 📖 完整文档(20分钟)
**文件:** `SKILL.md`
```bash
cat ~/.openclaw/skills/call-aida-app/SKILL.md
```
详细的 API 文档、参数说明和完整功能描述。
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Skill Enumeration

Medium
Category
Agent Snooping
Content
### 📖 完整文档(20分钟)
**文件:** `SKILL.md`
```bash
cat ~/.openclaw/skills/call-aida-app/SKILL.md
```
详细的 API 文档、参数说明和完整功能描述。
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Skill Enumeration

Medium
Category
Agent Snooping
Content
### 📖 完整文档(20分钟)
**文件:** `SKILL.md`
```bash
cat ~/.openclaw/skills/call-aida-app/SKILL.md
```
详细的 API 文档、参数说明和完整功能描述。
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Skill Enumeration

Medium
Category
Agent Snooping
Content
### 📖 完整文档(20分钟)
**文件:** `SKILL.md`
```bash
cat ~/.openclaw/skills/call-aida-app/SKILL.md
```
详细的 API 文档、参数说明和完整功能描述。
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The documentation instructs users to send arbitrary application inputs to an external AIDA API but does not clearly warn that the supplied content leaves the local environment and may contain sensitive data. This can lead users to unknowingly transmit secrets, personal data, or proprietary content to a remote service, especially because the examples normalize piping JSON directly into the tool.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The examples encourage persisting application outputs to local files and later include logging patterns for AIDA calls, but they do not warn that inputs, outputs, or error bodies may contain sensitive user data, tokens, or proprietary content. In an agent/integration skill, this is dangerous because operators often copy example code directly into production-like workflows, creating unintended data retention and disclosure risks.

Ssd 3

Medium
Confidence
96% confidence
Finding
The monitoring example writes AIDA call metadata and message content to a local log file, and the surrounding examples process user-controlled inputs and remote service responses. Because log messages and response fields can include sensitive prompts, extracted content, identifiers, or server error details, this pattern can leak confidential data to disk where it may be read by other local users, backups, or log processors.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The documentation explicitly directs users to send arbitrary inputs to a remote AIDA API endpoint, but it does not clearly warn that any submitted data leaves the local environment and may contain sensitive information. In an agent skill context, this omission can cause users or downstream agents to transmit prompts, documents, credentials, or other confidential data to a third-party service without informed consent.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The file’s headings and instructions are entirely in Chinese, which effectively forces a specific language for users of the skill. Under the policy, language constraints should either be optional, user-selectable, or clearly documented as a justified locale-specific limitation.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The quickstart instructs users to send arbitrary inputs and queries to a remote API endpoint and explicitly notes that the app ID is used as a Bearer token, but it provides no warning about transmitting sensitive data, credential handling, or external retention/logging risks. In a skill whose purpose is to forward user-provided content off-host, the lack of privacy and data-handling guidance can lead to accidental disclosure of confidential prompts, documents, or identifiers.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The README explicitly instructs users to send arbitrary `inputs`, optional `query`, and a `user` identifier to an external AIDA API, but it does not disclose the privacy, data handling, or sensitivity implications of transmitting that data off-host. In an agent/tooling context, this omission can lead operators to pass documents, prompts, or identifiers they would not have shared if the external transmission risk had been made clear.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger phrases are broad enough to match common requests like '生成变更报告' or generic references to 'AI 搭', which can cause the skill to activate in contexts where the user did not explicitly intend to call this specific internal service. Because the skill then instructs use of exec/bash to invoke a local script that forwards user-supplied parameters to an internal endpoint, accidental or inappropriate invocation increases the chance of unintended internal API usage and data exposure.

Missing User Warnings

Medium
Confidence
84% confidence
Finding
This skill transmits arbitrary user-provided inputs together with a bearer token to an external service, but the invocation flow and output do not present a clear user-facing warning or consent boundary. In agent environments, that increases the risk of unintended disclosure of secrets or sensitive business data when users or upstream tools pass data through the skill without realizing it leaves the local environment.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
This shell script contains all natural-language comments, prompts, errors, and next-step instructions in Chinese, which effectively forces a specific language for users. Under the policy, locale or language restrictions should either be optional for the user or clearly justified as region-specific.

Natural-Language Policy Violations

Medium
Confidence
89% confidence
Finding
This shell script uses Chinese for comments and all user-facing output, which can impose a specific language on users without opt-in. The policy allows locale constraints when clearly documented and justified, but this file itself does not state that it is intended only for Chinese-speaking or region-specific use.

Natural-Language Policy Violations

Low
Confidence
87% confidence
Finding
Natural-language policy issues apply to all file types, including markdown. This file forces a specific language/locale for core onboarding content and does not provide an opt-in, alternative language, or justification for the restriction.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
The file is written entirely in Chinese and demonstrates Chinese success/error messages and `zh-CN` as an input language, but does not indicate that language is configurable or intentionally limited to a China-specific context. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy concern.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The file title and all instructional content are presented in Chinese, and the navigation explicitly points users to a Chinese README, without indicating that the skill supports multiple languages or that Chinese is a required locale. Under SQP-3, forcing a specific language without user opt-in is a natural-language policy concern.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
The file presents all instructional content in Chinese and does not mention that the language is optional, user-selectable, or intended only for a Chinese-language audience. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy concern.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
The natural-language activation guidance is primarily defined in Chinese phrases, which effectively constrains intended usage to a specific language without stating that language choice is optional. The file does not indicate that equivalent triggers in other languages are supported or that the language restriction is intentional and justified.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The natural-language docstring and user-visible error/help text are written only in Chinese, which imposes a specific language on users without opt-in or justification. This matches the language/locale policy concern for skills that force a locale without offering a choice.

Static analysis

No suspicious patterns detected.