Back to skill

Security audit

Stocktoday Data

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real market-data skill, but it needs review because it can route token-backed API requests through configurable and documented unsafe gateways.

Install only if you trust StockToday's gateway with your Tushare/StockToday API token. Do not paste real tokens into chat or scripts, avoid token_info unless necessary, do not set TUSHARE_GATEWAY to an untrusted host, and do not use the documented HTTP backup gateway. Pin dependencies before production use and rotate any token previously sent through an unknown or plaintext gateway.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/proxy_demo.py:31
Finding

Arbitrary Gateway Configuration Can Disclose the API Token

Content
View full analysis
"ts.pro_api": """ 获取走 StockToday gateway 的 tushare pro client 优先顺序: 参数 > TUSHARE_TOKEN env > TUSHARE_GATEWAY env > 默认 gateway """ token = token or os.getenv("TUSHARE_TOKEN") or "your_token_here" gateway = gateway or os.getenv("TUSHARE_GATEWAY") or DEFAULT_GATEWAY pro = ts.pro_api(token) # 指向 stocktoday gateway pro._DataApi__token = token pro._DataApi__http_url = gateway return pro ``` ### Technical Analysis The client accepts a gateway from either a function argument or the `TUSHARE_GATEWAY` environment variable and assigns it directly to Tushare's internal HTTP endpoint. The value is not validated for an approved hostname, HTTPS transport, embedded credentials, loopback addresses, or private network destinations. Because the same client object contains the user's `TUSHARE_TOKEN`, subsequent API requests to the configured endpoint may transmit that credential to an attacker-controlled server. This is particularly dangerous in CI environments, shared shell profiles, wrappers, or automation systems where an attacker can influence environment variables without directly reading the token. This issue does not grant local code execution by itself. Exploitation requires influence over the gateway argument or environment variable and a subsequent authenticated API request. ### Attack Path 1. The victim has a valid `TUSHARE_TOKEN` in the environment. 2. An attacker or compromised wrapper sets `TUSHARE_GATEWAY` to an attacker-controlled URL, such as `https://attacker.example/`. 3. The victim invokes `get_client()` and performs a financial-data request. 4. The Tushare client sends the authenticated request to the configured malicious endpoint. 5. The ...[truncated 687 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/proxy_demo.py:24
Finding

Documented Backup Gateway Uses Plaintext HTTP

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/proxy_demo.py:99
Finding

API Token Prefix Is Written to Logs

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Dependencies Are Not Pinned to Reviewed Versions

Content
View full analysis
=1.4.0 pandas>=1.0 ``` ### Technical Analysis Both dependencies use open-ended minimum-version constraints. Each installation can therefore resolve to any later release accepted by the package resolver. The project does not include a reviewed lockfile or package hashes, making builds non-reproducible and increasing exposure to compromised upstream releases, malicious dependency updates, or unexpected security regressions. No specific malicious version or currently exploitable vulnerability was identified in the reviewed history. The risk is the uncontrolled supply-chain resolution policy rather than evidence that the named packages are malicious. Python packages can execute code during installation or import. Consequently, a compromised future release selected under these constraints could execute with the privileges of the account performing installation or running the Skill. ### Attack Path 1. A future package release is compromised, maliciously published, or introduces a security regression. 2. A user installs the project without a lockfile. 3. The resolver selects the affected release because it satisfies the open-ended `>=` constraint. 4. Package installation or import executes the affected dependency code. 5. The dependency operates with the installer or Skill process privileges and may access data available to that process, including environment variables such as `TUSHARE_TOKEN`. ### Impact Assessment The potential scope is the privilege level of the Python installation or runtime account. In a developer environment, this may include user files, environment variables, and outbound network access. In CI, it may include build secrets and repository credentials. Installation as an administrator would increase the possible impact. Actual i ...[truncated 149 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (14)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Credential/token introspection is context-inappropriate here because the skill is presented as a market-data research tool, yet it includes an operation that asks for a raw token and returns token metadata such as validity, permissions, and enabled plugins. That creates a direct secret-exposure path and can aid privilege enumeration if a token is leaked or mishandled.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill requests access to a sensitive environment variable (TUSHARE_TOKEN) and includes executable code patterns, but it does not declare any explicit tool scope, permissions, or allowed-tools boundaries. In an agent setting, this can cause over-broad authority: the runtime may expose environment access more widely than intended, increasing the chance of secret misuse or unauthorized networked API calls.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are extremely broad and map common everyday finance questions directly into skill activation. In agent orchestration, this can cause unintended invocation, leading the model to access network resources or sensitive environment-backed functionality when the user may only want general discussion rather than live data retrieval.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The section titled '中文自然语言默认口径' establishes Chinese as the default language/locale behavior, but the document does not offer a user-selectable language option or indicate that this is an opt-in regional mode. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless clearly justified and documented as region-specific.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest describes the skill as a financial and macro data research capability for stocks, funds, futures, options, bonds, and related market analysis workflows. This file additionally exposes movie box office, film script filing, TV filing, and Taiwan electronics revenue interfaces, which are not clearly part of that stated financial-market research scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documented token self-inspection endpoint is outside the core purpose of a financial research skill and introduces credential-handling behavior into an otherwise data-retrieval context. Even if it only introspects the caller's own token, encouraging token submission increases the chance that secrets are unnecessarily exposed to the model, logs, prompts, or downstream tooling.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation explicitly requests a token parameter without warning that it is sensitive, which normalizes placing credentials into prompts or tool calls. In an agent setting, that is dangerous because secrets may be stored in chat history, telemetry, debug traces, or third-party processors, turning a simple support action into credential exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The code reads a TUSHARE_TOKEN from the environment and silently applies it to a custom third-party gateway by overriding tushare client's private HTTP URL field. In this skill's context, that means credentials intended for the standard provider may be transparently transmitted to StockToday infrastructure or even an attacker-controlled endpoint via the TUSHARE_GATEWAY environment variable, creating a clear credential exposure and trust-boundary violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file’s natural-language instructions and examples are entirely in Chinese and describe how the LLM should work in that language/context, but there is no indication that this locale restriction is optional or limited to a justified region-specific use case. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
92% confidence
Finding

The dependency specification for tushare uses a lower-bound only constraint, which allows any future release to be installed. This creates supply-chain risk because newer major or minor versions may introduce vulnerable code, malicious compromise, or breaking behavior without review, reducing reproducibility and making security posture harder to verify.

Content

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

text
tushare>=1.4.0
pandas>=1.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The pandas requirement is unpinned and permits installation of any later version, making builds non-reproducible and preventing assurance about which code actually runs. In a data-processing skill that likely handles external market data, dependency drift increases the chance of pulling in a vulnerable or incompatible release from the Python supply chain.

Content

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

text
tushare>=1.4.0
pandas>=1.0

Unverifiable Dependency: pandas has 1 known advisory(ies) (CVE-2020-13091 (** DISPUTED ** pandas through 1.0.3 can unserialize and execute commands from an)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
40% confidence
Finding

Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file's top-level docstring and runtime messages are written entirely in Chinese, which imposes a specific language on users and integrators. Under the policy, language constraints should either offer a choice or be clearly documented as justified for a specific locale, neither of which appears here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Natural-language content in the module docstring is presented only in Chinese, and the same applies to multiple runtime messages and function descriptions. Under the stated policy, forcing a specific language without opt-in can be a language/locale policy violation unless the locale restriction is explicit and justified.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.