Back to skill

Security audit

A-Share Global Peer

Security checks for vulnerabilities and agentic risk

Overview

This finance-research skill is mostly purpose-aligned, but its documented shell-command workflow can let crafted company names execute unintended commands.

Review before installing. The skill appears intended for legitimate A-share peer research and does not show hidden exfiltration or persistence, but users should avoid passing untrusted company names into the documented shell command unless the agent uses safe argument passing or proper shell escaping.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:58
Finding

Shell Command Injection Through User-Controlled Company Argument

Content
View full analysis
" --output json ``` ### Technical Analysis The documented workflow instructs the Agent to place a user-provided company name or stock code directly into a shell command executed through the `exec` tool. Enclosing the value in double quotes does not prevent shell evaluation of command substitutions such as `$(...)` or backticks. A value containing a closing quote can also escape the intended argument and introduce additional shell syntax. The Python script itself uses `argparse` and does not invoke a shell. The vulnerability arises from the command construction prescribed in `SKILL.md`, before the value reaches the script. ### Attack Path 1. An attacker submits a crafted company name containing shell syntax, such as `$(id)`. 2. The Agent substitutes that value into the documented command: ```bash python3 scripts/get_company_products.py --company "$(id)" --output json ``` 3. If `exec` processes the command through a shell, the shell evaluates the substitution before launching Python. 4. The injected command runs under the operating-system identity and permissions assigned to the Agent. 5. A malicious payload could subsequently read accessible files, inspect environment variables, modify writable resources, or transmit accessible information over the network. ### Impact Assessment Successful exploitation permits arbitrary command execution within the Agent runtime. The attacker may obtain access to files, environment variables, credentials, and network capabilities available to the Agent account, including the optional `TUSHARE_TOKEN` if present in the process environment. This issue does not independently elevate privileges beyond the Agent account. Its scope is bounded by that account's filesystem ...[truncated 241 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

There is a clear description-behavior mismatch. The declared purpose centers on cross-border peer identification and comparative benchmarking between A-share companies and global leaders. The supplied code does not implement any peer-finding logic, foreign market data access, comparison analysis, or market share reporting. Instead, it accepts an A-share company name/code, optionally looks up basic stock metadata through Tushare, and otherwise suggests web searches for product/revenue breakdown. The mention of iFinD is only a placeholder note and not an implemented capability. Thus the actual primary purpose is company info/product query assistance, not global peer comparison.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest description says the skill triggers when the user asks for 'overseas peer/benchmark' or 'comparing A-share vs global leaders,' plus broad keywords like 'peer comparison' and 'benchmark.' These phrases are not narrowly scoped to this specific skill and could overlap with many ordinary finance comparison requests, increasing the risk of unintended invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The instructions state that all output reports must be in Chinese, which is a language-policy constraint expressed in natural language. Because no opt-in, override, or user choice is provided, this forces a specific language regardless of user preference.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The rule 'Output in Chinese - User-facing reports must be in Chinese for readability' imposes a fixed language policy. This is a natural-language policy violation because it does not offer a language choice or document a justified regional restriction.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes a skill for matching A-share companies to overseas listed peers across multiple regions and outputting comparison reports with market share data. This file instead documents and implements only retrieval of A-share company product/basic information via Tushare or fallback generation of web-search queries, with no peer matching, no overseas company discovery, and no comparison-report generation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file is a code file, so SQP-3 applies to its natural-language strings. The module description and example usage frame the skill specifically around A-share Chinese companies, and the generated search queries hard-code Chinese-language terms without offering a language choice or documenting this as a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The search query templates include Chinese phrases such as '主营业务 营收构成' and '产品结构 收入占比' and automatically emit them for all users. Because there is no user opt-in or configurable locale, this constitutes a language/locale policy issue under SQP-3.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The main execution path either returns basic Tushare company metadata or marks the result as a web-search fallback with generated search queries. That is materially narrower than the manifest's stated behavior of automatically identifying global peers and returning a structured benchmark report with market share information.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

Lines L124-L137 introduce Chinese-language terms such as "白酒", "贵州", and instruct users to label reports as "类比对标 (Analogy Benchmark)". This can impose a language/locale convention in outputs without documenting that the user requested or opted into bilingual/Chinese terminology.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module documentation states a source priority of 'iFinD (via skill) > Tushare (env var) > Web Search fallback'. However, the code in main only checks for a Tushare token/package and otherwise generates web-search recommendations; the get_from_ifind function is never invoked, so the documented priority contradicts actual behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.