Back to skill

Security audit

Skills of ETF data released by ft.tech.

Security checks for vulnerabilities and agentic risk

Overview

This ETF data skill is mostly coherent, but its PCF download helper can overwrite files through symlinks despite claiming local-path containment, so it should be reviewed before installation.

Install only if you are comfortable sending ETF lookup terms and related query parameters to market.ft.tech. Treat PCF downloads carefully: avoid writing to paths in shared or untrusted directories, and do not use an output filename that could already be a symlink until the download handler is hardened against symlink overwrites.

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
sub-skills/etf-pcf-download/scripts/handler.py:14
Finding

Symlink-Based Arbitrary File Overwrite in PCF Download Handler

Content
View full analysis
str: """将 output 规范为绝对路径,并限制在 base_dir 内,防止路径遍历。""" base_dir = (base_dir or os.getcwd()).rstrip(os.sep) base_abs = os.path.abspath(base_dir) resolved = os.path.abspath(os.path.normpath(path)) if os.path.commonpath([base_abs, resolved]) != base_abs: print( json.dumps({"error": "output path must be under base directory", "base": base_abs}, ensure_ascii=False), file=sys.stderr, ) sys.exit(1) return resolved ``` ```python if args.output is not None: out_path = _safe_output_path(args.output) with open(out_path, "wb") as f: f.write(data) ``` ### Technical Analysis The `_safe_output_path()` function verifies that the normalized lexical path is under the current working directory. However, `os.path.abspath()` and `os.path.normpath()` do not resolve symbolic links. The subsequent `open(out_path, "wb")` operation follows symbolic links by default. Therefore, an output path that appears to reside inside the permitted directory can resolve through a pre-existing symlink to a file outside that directory. Opening the target with `"wb"` immediately truncates an existing file before writing the downloaded PCF response. The containment check consequently does not enforce its documented security boundary against symlink-based escapes. Exploitation requires the attacker to: - Create or control a symbolic link within the working directory; and - Influence the `--output` argument, or predict an output filename that will be used. ### Attack Path 1. The attacker creates a symbolic link inside the permitted working directory: ```bash ln -s /path/to/writable/target output.xml ``` ...[truncated 1420 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (30)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The routing guide includes a trade-date utility function that is outside the narrowly stated ETF data capabilities. While this utility is not inherently dangerous, undeclared non-obvious functionality expands the effective scope of the skill and can bypass expectations about what will be executed.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The routing guide includes a trade-date utility function that is outside the narrowly stated ETF data capabilities. While this utility is not inherently dangerous, undeclared non-obvious functionality expands the effective scope of the skill and can bypass expectations about what will be executed.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The routing guide includes a trade-date utility function that is outside the narrowly stated ETF data capabilities. While this utility is not inherently dangerous, undeclared non-obvious functionality expands the effective scope of the skill and can bypass expectations about what will be executed.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 18)May include surrounding context.

md
`run.py` 与本文件(`SKILL.md`)位于同一目录。执行时:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill instructs the agent to invoke a local Python runner and make network requests, but it does not declare any explicit tool scope or permission boundaries. In an agent framework, missing scope metadata can allow over-broad shell, file-read, and network use, increasing the chance of unintended execution paths or abuse if the skill is triggered in the wrong context.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · run.py (reported line 57)May include surrounding context.

python
handler = os.path.join(sub_skills_dir, subskill, "scripts", "handler.py")

    result = subprocess.run(
        [sys.executable, handler] + sys.argv[2:],
        cwd=SKILL_ROOT,
    )

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description is entirely in Chinese and specifies the user utterances that should invoke the skill using only Chinese phrases. This creates a language/locale constraint without any indication that the skill is region-specific or that users may choose another language, which matches the policy concern for forced language behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest description says to use the skill when the user asks about '某只 ETF 详情、ETF 行情...ETF 名称/涨跌幅/跟踪指数/市值', which describes a broad class of common finance queries without explicit constraints or negative examples. This ambiguity could cause the skill to activate for general ETF-related discussion rather than only for single-ETF detail lookups.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The natural-language strings in the module docstring and CLI argument descriptions are exclusively in Chinese, with no indication that the skill supports other languages or that Chinese is a justified, documented locale restriction. This can violate language/locale policy when users are not offered an opt-in choice or alternative.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill description uses broad triggers such as 'ETF 列表、全市场 ETF、按涨跌幅排序的 ETF、筛选某类 ETF 时使用', which can cause the agent to invoke this skill for loosely related finance queries without strong routing constraints. Because the skill exposes flexible server-side filtering, sorting, field masks, and potentially unpaginated full-dataset retrieval, overbroad invocation increases the chance of unintended data access, excessive queries, or misuse in contexts where a narrower skill should have been selected.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code embeds the skill description and all user-facing argument help text in Chinese only, which imposes a specific language/locale on users without offering a choice. The policy explicitly calls out language or locale constraints as violations unless the user is given an opt-in or the constraint is clearly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description is written as an instruction in Chinese and does not indicate that other languages are supported or that the language requirement is optional. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation unless it is clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill description includes broad activation phrases such as 'PCF 文件内容' and '某只 ETF 申购赎回清单 XML', which can cause the agent to invoke this download-oriented skill for general informational queries rather than explicit file-download requests. That increases the chance of unintended binary/XML retrieval, tool overuse, and bypass of more appropriate read/list/detail skills, especially when the filename may later be derived from untrusted upstream content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Natural-language strings in the module docstring, argument description, and help text are entirely in Chinese, which imposes a specific language on users. The file does not offer an alternative language, user opt-in, or any documentation that this skill is intentionally limited to a Chinese-speaking or region-specific audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language content in the manifest description and the entire markdown body is Chinese-only, which effectively forces a specific language for users. The file does not provide an opt-in language choice or explain that the skill is intentionally limited to a Chinese-speaking or region-specific audience.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description says to use this skill whenever a user asks about an ETF's intraday, same-day trend, multi-day intraday trend, or one-minute market data, but it does not provide explicit trigger phrases, exclusions, or negative examples. In a markdown skill file, this can create ambiguous routing between this skill and other finance or market-data skills.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Natural-language strings in the docstring, CLI help text, and error messages are all presented only in Chinese. This can violate language/locale policy when a skill forces a specific language without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The natural-language description is entirely in Chinese and specifies usage patterns in Chinese phrases, but it does not indicate that the skill is region-specific or that users may choose another language. Under the policy, forcing a specific language without opt-in is a locale/language policy concern.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The description says to use the skill whenever users ask about an ETF quote, list, K-line, intraday data, or PCF, but it does not define any exclusion conditions or scope boundaries. In a manifest/markdown context, this broad natural-language trigger guidance could overlap with many ordinary finance questions and cause unintended invocation of this routing skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The table is framed as '用户常说的词' and includes broad phrases like 'ETF 列表', '下载 PCF', and '前 N 个交易日' without explicit non-matching examples. For markdown skill routing guidance, this can make activation ambiguous because the same phrases may appear in broader conversations where this skill is not appropriate.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring and CLI usage/help text are written only in Chinese, and the runtime error/usage messages also assume Chinese output. This creates a language/locale policy concern because the skill presents a single language without offering the user any language choice or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The module docstring and CLI descriptions are presented exclusively in Chinese, which can amount to a language-policy issue when no user opt-in or locale justification is provided. There is no indication in this file that the skill is intentionally restricted to Chinese-speaking users or a China-specific deployment context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

This code builds and sends an HTTP GET request to an external service using the user-supplied symbol. Although the purpose implies data lookup, there is no runtime notice, confirmation, or explicit user-facing warning in this file that the symbol will be sent to a remote endpoint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

Natural-language strings in the module docstring and CLI help text are exclusively Chinese, which can amount to a language policy issue when no language choice or opt-in is offered. The file does not indicate that Chinese is a justified locale restriction or provide an alternative language path.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This Python file constructs a URL from user inputs and sends an HTTP request to an external service, which is a code-file operation covered by the missing-warning rule. While the behavior is functionally expected for a market-data lookup tool, the file itself contains no confirmation prompt, user-facing log, or comment/docstring disclosing that the supplied symbol and query parameters will be sent to market.ft.tech.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.