Back to skill

Security audit

Tencent Finance Stock Price

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward stock quote tool, but users should know it sends queried symbols to Tencent over unauthenticated HTTP.

Install only if you are comfortable with queried stock symbols being sent to Tencent Finance over plaintext HTTP. Treat results as informational and verify prices with an authenticated source before making financial decisions; also expect parts of the command-line output to be in Chinese.

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/query_stock.py:56
Finding
Unauthenticated Plaintext HTTP Allows Stock Quote Tampering## Vulnerability Details **File Location**: `scripts/query_stock.py`, lines 56–59 **Vulnerability Type**: Unauthenticated plaintext HTTP transport **Risk Level**: Medium ### Vulnerable Code ```python resolved = [resolve_code(c) for c in codes] url = f"http://qt.gtimg.cn/q={urllib.parse.quote(','.join(resolved))}" try: with urllib.request.urlopen(url, timeout=10) as resp: raw = resp.read() ``` ### Technical Analysis The script retrieves financial data from Tencent Finance over plaintext HTTP. HTTP does not authenticate the server or protect the response's integrity and confidentiality. Although the query values are URL-encoded, URL encoding provides no transport security. The application parses the response without cryptographic integrity checks and presents its fields as trusted market data. A network-positioned attacker can therefore read requested stock symbols, intercept the request, and substitute a forged response in the format expected by the parser. This issue does not enable local code execution or privilege escalation based on the reviewed code. It compromises the confidentiality and integrity of network requests and financial results. ### Attack Path 1. A user invokes the Skill with one or more stock symbols. 2. The script sends a plaintext HTTP request to `qt.gtimg.cn`. 3. An attacker controlling or observing a network intermediary—such as a malicious Wi-Fi access point, proxy, router, or compromised gateway—intercepts the request. 4. The attacker returns a forged response containing the expected `v_...="...~..."` structure. 5. The script decodes and parses the response without authenticating its origin or validating its integrity. 6. Manipulated prices, percentage changes, market capitalization values, company names, or other financial metrics are displayed as legitimate data. ### Impact Assessment A successful attacker can: - Observe which stock symbols the user queries. - Modify or fabricate stock quote responses. - Misle ...[truncated 407 chars]
Remediation
## Remediation Suggestions 1. Replace the plaintext endpoint with an HTTPS endpoint from the provider and rely on standard certificate and hostname validation: ```python url = f"https://qt.gtimg.cn/q={urllib.parse.quote(','.join(resolved))}" ``` 2. Confirm that the HTTPS endpoint is officially supported and returns the expected data before deployment. Do not disable TLS certificate validation or accept invalid certificates. 3. If Tencent does not provide a supported HTTPS endpoint, migrate to a reputable market-data provider that offers authenticated HTTPS transport, or place a controlled HTTPS relay in front of the upstream service. 4. If plaintext upstream communication is unavoidable, clearly warn that responses are unauthenticated and must not be used as the sole basis for trading or other consequential decisions. 5. For higher-assurance use cases, validate quote data against an independent authenticated source and reject malformed or implausible responses rather than displaying them as trusted results.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill performs network-backed data retrieval but does not declare any explicit tool scope or permissions boundary in the skill manifest. This creates a least-privilege and transparency problem: a host agent may allow broader-than-expected execution or users may invoke a skill that can make outbound requests without that capability being clearly declared and reviewed.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
Natural-language strings throughout the script, including errors, help text, labels, and output formatting, are presented only in Chinese. Under the locale policy, forcing a specific language without user choice is a policy concern unless the locale restriction is explicitly documented and justified.

Missing User Warnings

Low
Confidence
84% confidence
Finding
This code file performs an HTTP request to qt.gtimg.cn using user-supplied stock codes, but the runtime path provides no explicit notice at the point of execution that inputs will be transmitted to an external service. The docstring names the API, but there is no user-facing warning, prompt, or privacy note explaining the outbound request behavior.

Static analysis

No suspicious patterns detected.