Back to skill

Security audit

A 股市场日报

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward A-share market report generator, but users should be aware its market data is fetched over plaintext HTTP and its Python dependency is not pinned.

Install this only if you are comfortable running a local Python script that makes public Eastmoney market-data requests. Treat the output as informational, verify important figures from a trusted source, and prefer pinning dependencies or updating the endpoint to HTTPS before relying on it for financial analysis.

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
scripts/a_stock_daily_report.py:18
Finding
Financial market data retrieved over unencrypted HTTP<![CDATA[ ## Vulnerability Details **File Location**: `scripts/a_stock_daily_report.py`, lines 18-32 **Vulnerability Type**: Unauthenticated and unencrypted network transport **Risk Level**: Medium ### Vulnerable Code ```python # 东方财富 API 基础 URL BASE_URL = "http://push2.eastmoney.com/api/qt" def __init__(self, timeout: int = 5): self.timeout = timeout self.session = requests.Session() def _get(self, url: str, params: Optional[Dict] = None) -> Optional[Dict]: """发送 GET 请求""" try: resp = self.session.get(url, params=params, timeout=self.timeout) resp.raise_for_status() return resp.json() except Exception as e: print(f"请求失败:{e}") return None ``` ### Technical Analysis The Eastmoney API base URL uses plaintext HTTP. Consequently, requests and responses lack transport confidentiality, server authentication, and integrity protection. The script accepts the returned JSON without an independent authenticity check and incorporates its values directly into the generated financial report. An attacker able to control or intercept the network path could impersonate the API endpoint or alter its responses. The expected JSON structure could be preserved while index values, stock prices, percentage changes, sector rankings, and stock names are replaced with attacker-selected values. ### Attack Path 1. A user runs the report script on a network observed or controlled by an attacker, such as a compromised router, proxy, access point, or upstream network. 2. The script requests `http://push2.eastmoney.com/api/qt/...`. 3. Because the connection does not use TLS, the attacker intercepts the request and returns a forged HTTP response. 4. The forged response contains syntactically valid JSON with manipulated financial values. 5. `_get()` accepts and parses the response. 6. `generate_report()` presents the manipulated values as legitimate market information. ### Impact Assessment This issue does not directly gra ...[truncated 402 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Change the API base URL to HTTPS: ```python BASE_URL = "https://push2.eastmoney.com/api/qt" ``` 2. Preserve the default TLS certificate and hostname verification behavior in `requests`; do not introduce `verify=False`. 3. Fail closed when TLS validation, JSON decoding, or response validation fails. 4. Validate the response schema and expected value types before generating the report. 5. Consider applying reasonable value-range and format checks to reduce the effect of malformed upstream data. 6. Update the endpoint examples in `SKILL.md` to use HTTPS so the documentation does not encourage insecure transport. ]]>

T08 · Insecure Dependencies

Note
Location
README.md:8
Finding
Unpinned third-party dependency installation<![CDATA[ ## Vulnerability Details **File Location**: `README.md`, line 8; `SKILL.md`, line 76 **Vulnerability Type**: Unconstrained package installation from the configured Python package index **Risk Level**: Low ### Vulnerable Code `README.md`: ```bash pip install requests ``` `SKILL.md`: ```bash pip install requests ``` ### Technical Analysis The installation instructions specify the `requests` package without an exact version or integrity hash. Package resolution therefore depends on the active package index configuration and whichever release satisfies the unconstrained requirement at installation time. This prevents reproducible dependency resolution and provides no project-level integrity verification. If the configured index is compromised, replaced by an untrusted mirror, or influenced through unsafe pip configuration, installation could resolve to a malicious or otherwise unreviewed distribution. A future incompatible release could also alter behavior or break the skill. The package name itself is correctly spelled, and the audit found no evidence that the currently named `requests` package is malicious. The risk arises from unconstrained, unhashed resolution rather than a confirmed malicious dependency. ### Attack Path 1. A user follows the documented command in an environment with a compromised or attacker-controlled package index, mirror, or pip configuration. 2. `pip` resolves the unconstrained `requests` requirement from that source. 3. The source supplies an attacker-controlled distribution or dependency artifact. 4. The artifact is installed into the selected Python environment. 5. Malicious package code executes during an applicable installation or import path. 6. When the report script imports `requests`, the malicious component can operate with the privileges of the user running the script. ### Impact Assessment Successful exploitation through a malicious dependency could execute arbitrary Python code with the installing or invo ...[truncated 332 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Declare dependencies in a dedicated requirements or lock file rather than relying only on an ad hoc installation command. 2. Pin `requests` and its transitive dependencies to reviewed versions. 3. Generate and verify cryptographic hashes, for example by using a requirements file with `pip install --require-hashes -r requirements.txt`. 4. Review and update pinned versions regularly to incorporate security fixes. 5. Install dependencies in an isolated virtual environment with the minimum necessary privileges. 6. Use a trusted package index and review pip configuration to ensure an unexpected mirror or extra index cannot override dependency resolution. 7. Update both `README.md` and `SKILL.md` so they provide the same hardened installation procedure. ]]>
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Natural-Language Policy Violations

Medium
Confidence
89% confidence
Finding
The skill description, usage examples, output sample, and warnings are all presented exclusively in Chinese, indicating the skill is intended to operate in a fixed language/locale. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is clearly documented and justified.

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill clearly instructs users to run a Python script that performs outbound HTTP requests to Eastmoney APIs, but the manifest does not declare any tool scope such as permissions or allowed-tools. This creates a mismatch between documented behavior and declared capabilities, which weakens reviewability and can allow network access to be used without explicit authorization boundaries.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The manifest description, headings, usage examples, and cautions are all presented only in Chinese, with no indication that users may choose another language or locale. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless clearly justified as region-specific and documented as such.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
This code is a Python file, so only SQP-2 and SQP-3 apply. The script’s docstrings and all generated report text are fixed in Chinese, including user-facing strings in the report body, without any opt-in, configuration, or explanation that the skill is intentionally limited to a Chinese-speaking audience.

Description-Behavior Mismatch

Low
Confidence
94% confidence
Finding
The manifest description scopes the skill to '大盘指数、热门板块和龙头股', which matches the index, sector, and sector-leader functions. However, the implementation adds separate capabilities for screening historical-high and 20/60-day-high stocks and includes them in the final report, expanding the report beyond the declared content areas.

Static analysis

No suspicious patterns detected.