Back to skill

Security audit

FinXData Chinese Stock Data

Security checks across malware telemetry and agentic risk

Overview

The skill is a coherent FinXData lookup tool, but its wrapper can expose the user's FinXData API key in local process arguments.

Review before installing if you will use a real FINXDATA_API_KEY, especially on shared, monitored, or multi-user machines. The skill appears intended for read-only financial data queries to api.finxdata.ai, but rotate the key if you already used it in an environment where process command lines may be logged or visible.

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
scripts/finxdata.py:550
Finding
API Key Exposed Through Child-Process Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/finxdata.py:550-562` **Vulnerability Type**: Sensitive credential exposure through process arguments **Risk Level**: Medium ### Vulnerable Code ```python api_key = env_api_key() if api_key_required else None if api_key: args.extend(["-H", f"X-API-Key: {api_key}"]) if idempotency_key: args.extend(["-H", f"Idempotency-Key: {idempotency_key}"]) if agent_type: args.extend(["-H", f"x-agent-type: {agent_type}"]) args.append(url) return args def run_curl(args: list[str], *, agent_endpoint: bool = False) -> None: result = subprocess.run(args, capture_output=True, text=True, check=False) ``` ### Technical Analysis The code inserts `FINXDATA_API_KEY` directly into the argument vector of a spawned `curl` process as an HTTP header. Although the request uses HTTPS, transport encryption does not protect secrets exposed locally through process metadata. Depending on the operating system, process isolation settings, container configuration, and monitoring environment, another local process with sufficient visibility may inspect the `curl` command line through process-listing tools, process APIs, audit logs, or `/proc` interfaces. The complete API key can therefore remain observable for the duration of the request. The use of an argument list rather than `shell=True` prevents shell command injection, but it does not prevent command-line credential disclosure. The existing output sanitization also does not protect the child process argument vector. ### Attack Path 1. A user exports a valid `FINXDATA_API_KEY` and invokes an authenticated FinXData command. 2. The wrapper reads the key from the environment. 3. `build_curl_args` embeds the key in the argument `X-API-Key: <secret>`. 4. `subprocess.run` launches `curl` with that secret in its process arguments. 5. During execution, a local attacker, co-tenant, diagnostic agent, or monitoring service with process-inspection access reads the `curl` ...[truncated 970 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Prefer an in-process HTTPS client.** Replace the `curl` subprocess with a maintained Python HTTP library or the standard library so the API key can be assigned directly to an HTTP header without entering a child-process argument vector. 2. **Preserve existing network controls.** The replacement must retain TLS certificate verification, the fixed `https://api.finxdata.ai` origin allowlist, redirect prohibition, timeout limits, bounded retries, and the rule that API keys are not sent to health, summary, or Agent endpoints. 3. **If `curl` must remain, avoid command-line secrets.** Supply the sensitive header through a protected file descriptor or a temporary curl configuration file created with owner-only permissions such as mode `0600`. Delete the file immediately after use, including on exceptions and interruption. 4. **Do not move the key into another observable channel.** Avoid placing it in URLs, logs, exception messages, debug output, shell-expanded command strings, or broadly inherited environment variables. 5. **Minimize secret lifetime.** Read the credential only when required, restrict its propagation to the request implementation, and avoid retaining additional copies. 6. **Add regression tests.** Verify that authenticated requests work while the generated process arguments, logs, and errors never contain the API key. Also verify that unauthenticated and Agent endpoints never receive it. 7. **Rotate potentially exposed credentials.** Users who executed the current implementation in shared or monitored environments should revoke and replace the affected API keys. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (3)

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill explicitly instructs use of environment variables, shell commands, and outbound HTTPS requests, but it does not declare corresponding permissions. This creates a trust and review gap: a host may expose env, network, or shell access to a skill that appears less privileged than it really is, increasing the chance of unintended secret exposure or command execution.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The skill enables implicit invocation without any visible trigger constraints, which can cause the agent to call this finance-data skill automatically in situations the user did not clearly intend. In a financial context, that can lead to unnecessary external data access, unexpected tool use, privacy leakage through query contents, or user confusion about why a third-party API was contacted.

Missing User Warnings

Low
Confidence
92% confidence
Finding
The documentation states that agent-facing public endpoints '会按来源头统计调用来源和频率', which implies collection and monitoring of request-origin metadata, but it does not clearly disclose what is collected, how it is used, or any retention/privacy implications. This is a genuine transparency and privacy issue because users may unknowingly transmit identifiable client metadata when using the public agent mode.

VirusTotal

VirusTotal findings are pending for this skill version.

View on VirusTotal

Static analysis

No suspicious patterns detected.