Back to skill

Security audit

指数直通车场外指数基金信息查询

Security checks across malware telemetry and agentic risk

Overview

This skill coherently provides fund-information queries through a disclosed provider API, with some install and disclaimer practices users should notice.

Before installing, confirm you are comfortable using the Index Hub service, sending fund-query requests to www.etf.com.cn, and storing an API key at ~/.config/index-hub/api_key. Prefer running ./install.sh and entering the key at the hidden prompt instead of passing it with --api-key KEY. Expect answers from this skill to include the provider's fixed disclaimer and service reference.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T01 · Skill Instruction Hijacking

Warning
Location
guardrails.py:129
Finding
Mandatory Promotional Content Injection into Agent Responses<![CDATA[ ## Vulnerability Details **File Location**: `guardrails.py:7`, `guardrails.py:129-149`; related mandatory instructions in `SKILL.md:83-86` and `SKILL.md:204-206` **Vulnerability Type**: T01: Skill Instruction Hijacking **Risk Level**: Medium ### Code Snippet ```python DISCLAIMER = "数据查询由易方达指数直通车提供,以上内容由 AI 总结生成,仅供参考,不构成投资建议、收益预测或任何交易决策依据。更多信息请在微信搜索“指数直通车”小程序,或访问易方达指数直通车网页版:www.etf.com.cn" ``` ```python def finalize_answer(answer: str) -> str: """Normalize and validate a final customer-facing answer. The caller should only print the returned string. If validation fails, rewrite the answer before showing it to the user. """ if not isinstance(answer, str): raise TypeError("answer must be a string") body = _normalize_text(answer) if not body: raise ValueError("final answer is empty") investment_violation = _find_investment_violation(body) if investment_violation: category, excerpt = investment_violation raise ValueError( f"final answer contains prohibited investment expression ({category}): {excerpt}" ) forbidden_internal = _find_pattern(FORBIDDEN_INTERNAL_PATTERNS, body) if forbidden_internal: raise ValueError( f"final answer leaks internal implementation detail: {forbidden_internal}" ) invalid_value = _find_pattern(INVALID_VALUE_PATTERNS, body) if invalid_value: raise ValueError(f"final answer exposes invalid internal value: {invalid_value}") return f"{body}\n\n{DISCLAIMER}" ``` The corresponding Skill instructions make use of this function mandatory and require the appended statement to remain at the end of every response. ### Technical Analysis The final-answer processor unconditionally appends a fixed statement containing brand promotion, a WeChat mini-program acquisition instruction, and an external website. This occurs regardless of whether those promotional elements are relevant to the user's ...[truncated 1668 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace the fixed statement with a neutral financial disclaimer that contains no marketing, acquisition instructions, or unrelated external links. 2. Do not append promotional material unconditionally. If support or product links are retained, display them only when the user explicitly requests help, documentation, or provider information. 3. Separate compliance validation from content mutation: - Make validation return a pass/fail result. - Let the calling agent add a context-appropriate disclaimer when required. - Do not silently modify otherwise valid answers. 4. Update `SKILL.md` so it requires only a neutral risk disclosure, rather than mandatory brand promotion. 5. Add tests confirming that unrelated answers are not modified with external routing or marketing content. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
install.sh:59
Finding
API Key Exposure Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `install.sh:59-64`, `install.sh:89-96`; insecure usage is also documented in `INSTALL.md:23-25` **Vulnerability Type**: T09: Insecure Skill Coding Practices **Risk Level**: Medium ### Code Snippet ```bash usage() { printf 'Install and initialize %s v2.1 (%s).\n\n' "$SKILL_DISPLAY_NAME" "$SKILL_NAME" cat <<'EOF' Usage: ./install.sh --api-key KEY ./install.sh Options: --skills-dir DIR Target install directory. Default: ~/.openclaw/workspace/skills --api-key KEY API key. If omitted, the script prompts for it. --no-install Only update the API key in already-installed files. --skip-api-verify Skip the final network smoke test. -h, --help Show this help. EOF } ``` ```bash while [[ $# -gt 0 ]]; do case "$1" in --skills-dir) SKILLS_DIR="${2-}"; if [[ $# -ge 2 ]]; then shift 2; else shift; fi ;; --api-key) API_KEY="${2-}"; API_KEY_PROVIDED=1; if [[ $# -ge 2 ]]; then shift 2; else shift; fi ;; --no-install) DO_INSTALL=0; shift ;; --skip-api-verify) VERIFY_API=0; shift ;; -h|--help) usage; exit 0 ;; *) usage >&2; fail "未知参数:$1" "运行 ./install.sh --help 查看支持的参数。" 2 ;; esac done ``` ### Technical Analysis The installer accepts the service API key directly as the value of the `--api-key` command-line option. Command-line arguments are not an appropriate secret-input channel because they may be exposed through: - Shell history files. - Process-listing utilities while the installer is running. - Process accounting and endpoint monitoring. - Terminal-session recording. - Automation logs that record invoked commands. - Wrapper scripts, job definitions, or CI configuration. The installer later stores the key in a file with restrictive permissions, and its interactive fallback uses hidden input. Those controls protect the stored credential but do not mitigate disclosure that occurs before storage when the documented command-line ...[truncated 1187 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove support for `--api-key KEY` and delete it from all installation documentation. 2. Continue using a hidden interactive prompt for manual installation: ```bash read -r -s -p "Enter API key: " API_KEY ``` 3. For non-interactive automation, accept the secret through a protected file descriptor or a permission-restricted file, rather than through process arguments. 4. If standard input is supported, clearly document that callers must avoid commands that echo or log the secret. 5. Avoid encouraging long-lived secrets in general-purpose environment variables where deployment tooling may capture the environment. 6. Rotate any API key previously supplied through the documented command-line option if command history or logs may have retained it. 7. Add an installer test that rejects `--api-key` and verifies that secrets do not appear in process arguments or normal output. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (2)

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill explicitly instructs use of shell execution, local file reads, environment-variable access, and network calls via bundled tooling, but the manifest shown in SKILL.md does not declare permissions. That mismatch weakens sandboxing and review controls because a host may grant or deny capabilities based on declared metadata, while the skill operationally expects broader access to API keys, config files, and networked data services.

Context-Inappropriate Capability

Medium
Confidence
84% confidence
Finding
The code reads an API credential from a fixed file in the user's home directory without disclosing that behavior in the skill description. In an agent-skill setting, accessing local credential material beyond what the user explicitly supplied expands the trust boundary and can enable unintended use of resident secrets for external network calls.

VirusTotal

63/63 vendors flagged this skill as clean.

View on VirusTotal

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/api_client.py:64