Back to skill

Security audit

通达信TDX股票查询技能

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed stock-data API client, but it includes under-scoped background ingestion/task-management powers and recommends plaintext API endpoints.

Install only if you operate and trust the configured API services. Prefer HTTPS endpoints, isolate the runtime, pin dependencies, and treat task-creation/cancellation methods as privileged operations because they can start backend jobs and leave stored data behind.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
main.py:14
Finding

Plaintext HTTP Endpoints Are Accepted and Explicitly Recommended

Content
View full analysis
Dict: try: url = f"{self.api_url}{endpoint}" if method == 'GET': response = requests.get(url, params=params, timeout=30) elif method == 'POST': response = requests.post(url, json=data, params=params, timeout=30) ``` The documentation explicitly provides plaintext endpoint examples: ```text TDX_API_URL=http://your-api-domain.com AKSHARE_API_URL=http://your-akshare-api.com ``` ### Technical Analysis The constructor accepts arbitrary URL strings without parsing or enforcing an HTTPS scheme. All API operations subsequently use the configured URL directly. This includes stock symbols, search keywords, date ranges, watchlists, task identifiers, remote storage-directory values, and remote task-management commands. When the documented `http://` configuration is used, TLS does not protect the traffic. An on-path attacker can inspect requests, observe potentially private investment interests or search activity, modify returned financial information, or tamper with task-management responses. Thi ...[truncated 2348 chars]
Remediation
View remediation
str: parsed = urlparse(value) if parsed.scheme != "https": raise ValueError("API endpoints must use HTTPS") if not parsed.hostname or parsed.username or parsed.password: raise ValueError("Invalid API endpoint") return value.rstrip("/") ``` ]]>

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Open-Ended Dependency Constraints Prevent Reproducible Installation

Content
View full analysis
=2.31.0 python-dotenv>=1.0.0 ``` The documented installation command is: ```bash pip install -r requirements.txt ``` ### Technical Analysis Both dependencies use minimum-version constraints without upper bounds, exact versions, hashes, or a lock file. As a result, two installations performed at different times can resolve to different direct and transitive dependency versions. The package names are legitimate and commonly used, and the audit found no typosquatting, dependency confusion, custom package index, or known malicious package in the project. The finding is therefore a supply-chain hardening deficiency rather than evidence that the current dependencies are malicious. A future compromised, vulnerable, or incompatible release satisfying these constraints could be installed automatically without a corresponding review of this Skill. Python packages may execute code during installation or when imported, so dependency resolution is part of the Skill's effective trust boundary. ### Attack Path 1. A user runs the documented `pip install -r requirements.txt` command. 2. The package resolver selects the newest available versions satisfying the open-ended constraints. 3. A future selected release or transitive dependency contains malicious code or a security regression. 4. The dependency executes code during installation or when imported by `main.py`. 5. The malicious dependency obtains the privileges of the user running the installation or Skill. This path requires compromise or vulnerability of a dependency release or its distribution channel; no such compromise was established during this audit. ### Impact Assessment If a malicious dependency version were resolved, its code would execute with the same operating-system privileges as th ...[truncated 517 chars]
Remediation
View remediation
\ --hash=sha256: python-dotenv== \ --hash=sha256: ``` ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (19)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 55)May include surrounding context.

复制 .env.example 为 .env:

bash
cp .env.example .env

编辑 .env 文件,填入你的TDX API地址:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README advertises background data-ingestion and storage tasks but does not warn users that invoking these features may cause data to be written to or retained by a backend service. In an agent-skill context, that omission can lead to unintentional persistence of queried symbols, historical datasets, or operational metadata, creating privacy, governance, and unexpected side-effect risks.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill requires environment access and outbound network access via TDX_API_URL and optional AKSHARE_API_URL, but it declares no explicit tool scope or permission boundary. That creates an authorization ambiguity where a host agent may invoke a network-capable skill without clear least-privilege constraints or user visibility into external data flows.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger condition 'when the user asks about stock-related information' is overly broad and can cause the skill to activate for loosely related prompts. In context, this matters because the skill can reach external APIs and initiate background tasks, so over-triggering increases the chance of unintended network access or task creation without sufficiently specific user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation advertises background 'data ingestion/storage tasks' that write to local directories and persist market data, but it does not clearly warn users about filesystem modification, storage growth, retention, or ongoing asynchronous activity. In an agent setting, hidden persistence and background execution change the risk profile from a simple query skill to one that can consume disk, leave residual data, and operate beyond the immediate user interaction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The configuration examples encourage plain HTTP endpoints for TDX and AKSHARE services without warning about insecure transport or the fact that user queries and requested symbols may be sent to external systems. This exposes requests and returned market/news content to interception or tampering if used over untrusted networks, and it obscures the external data-sharing boundary from users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file presents all user-facing documentation in Chinese, including headings, descriptions, and conclusions, with no indication that users can choose another language. Under SQP-3, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The test report shows the skill includes task-management and data-pulling interfaces such as create/cancel task operations, which exceeds the stated scope of a read-only stock query skill. In an agent setting, this broadens the action surface from passive retrieval to state-changing operations, increasing the chance of misuse, unintended background jobs, or abuse of backend resources.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Comments, exceptions, docstrings, and console output throughout the file are written in Chinese, with no indication that the skill is intentionally limited to Chinese-speaking users or tied to a justified region-specific deployment. This creates a natural-language locale policy issue because the skill effectively forces one language without opt-in or documented constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code file performs HTTP GET/POST requests to configured API servers and transmits user-provided query data such as stock codes, keywords, and dates, but the core request method has no user-facing logging, confirmation, or warning about sending that data over the network. While network access is the skill's general purpose, the code itself does not disclose that user inputs are transmitted to external services, which matters for privacy and operational transparency.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · main.py (reported line 33)May include surrounding context.

python
if method == 'GET':
                response = requests.get(url, params=params, timeout=30)
            elif method == 'POST':
                response = requests.post(url, json=data, params=params, timeout=30)
            else:
                return {"code": -1, "message": f"不支持的HTTP方法: {method}"}

Tainted flow: 'data' from requests.get (line 610, network input) → requests.post (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · main.py (reported line 33)May include surrounding context.

python
if method == 'GET':
                response = requests.get(url, params=params, timeout=30)
            elif method == 'POST':
                response = requests.post(url, json=data, params=params, timeout=30)
            else:
                return {"code": -1, "message": f"不支持的HTTP方法: {method}"}

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is described as a stock query tool, but it also exposes methods to create and cancel remote data-pull tasks that can trigger server-side ingestion and persistence. This expands capability from read-only querying to state-changing operations, which can be abused to start expensive jobs, write to arbitrary server-side paths via the dir parameter, or disrupt running tasks if an agent invokes them without explicit user understanding and authorization.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The setup instructions direct users to configure an external API endpoint but do not warn that stock queries and possibly task/job metadata will be sent to that remote service. This is a real transparency and privacy issue because users may assume the skill is local-only when it actually transmits data off-box.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The report discloses an internal network API endpoint (http://10.0.0.8:53270), revealing internal addressing and service location details. While not directly exploitable by itself, this is sensitive infrastructure information that can aid reconnaissance, encourage internal-resource access patterns, or facilitate SSRF-style targeting in environments where agents can reach internal networks.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency is specified with a lower-bound only (requests>=2.31.0), which makes builds non-reproducible and allows future installs to resolve to unexpected versions, including vulnerable or breaking releases. In a stock-query skill that makes outbound HTTP requests, dependency drift in requests can directly affect transport security, credential handling, and request behavior.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.31.0
python-dotenv>=1.0.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
87% confidence
Finding

The manifest does not pin requests, and the package has multiple known advisories across versions, so the deployed build may resolve to a version that is affected without any visibility from the manifest alone. In this skill, which is expected to query external market data over HTTP, use of an affected requests release could expose credentials, weaken request verification, or otherwise compromise data exchange depending on the exact version installed.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

python-dotenv>=1.0.0 is also unpinned, so installations are not deterministic and may pick up future releases with security regressions or incompatible behavior. Because this package influences environment-variable loading, version drift can affect secret handling and local file interactions in ways that are hard to audit.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
requests>=2.31.0
python-dotenv>=1.0.0

Unverifiable Dependency: python-dotenv has 2 known advisory(ies) (CVE-2026-28684 (python-dotenv: Symlink following in set_key allows arbitrary file overwrite via ); CVE-2026-28684 (python-dotenv reads key-value pairs from a .env file and can set them as environ)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
80% confidence
Finding

Because python-dotenv is unpinned and has published advisories in some versions, the manifest leaves open the possibility that deployments will install an affected release. Given that dotenv libraries interact with environment files and secrets, a vulnerable version could contribute to unsafe file handling or secret exposure depending on how the skill uses it.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.