Back to skill

Security audit

A Stock Daily Report

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward A-share market report generator, but its financial output should be treated as a rough, non-advisory summary.

Install only if you are comfortable with a Chinese-language A-share report that uses public Eastmoney data, includes unavailable fields as '--', and generates simple heuristic strategy text. Do not treat the output as verified real-time capital-flow data or investment advice, especially because the current implementation retrieves market data over unencrypted HTTP.

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/a-stock-report.js:13
Finding
Market Data Retrieved Over Unencrypted HTTP<![CDATA[ ## Vulnerability Details **File Location**: `scripts/a-stock-report.js`, lines 13-14 **Vulnerability Type**: Use of plaintext HTTP for integrity-sensitive financial data **Risk Level**: Medium ### Vulnerable Code ```javascript const CONFIG = { eastmoneyBoardApi: 'http://push2.eastmoney.com/api/qt/clist/get', eastmoneyStockApi: 'http://push2.eastmoney.com/api/qt/stock/get', }; ``` The configured endpoints are subsequently passed to a client selected according to the URL scheme: ```javascript function httpGet(url, options = {}) { return new Promise((resolve, reject) => { const client = url.startsWith('https') ? https : http; const req = client.get(url, options, (res) => { let data = ''; res.on('data', (chunk) => data += chunk); res.on('end', () => { try { resolve(JSON.parse(data)); } catch (e) { reject(e); } }); }); req.on('error', reject); req.setTimeout(10000, () => { req.destroy(); reject(new Error('Request timeout')); }); }); } ``` API-controlled board data is then inserted into Markdown without escaping: ```javascript hotBoards.slice(0, 5).forEach((board, i) => { report += `| ${i + 1} | ${board.name} | ${board.change} | ${board.leader} |\n`; }); ``` ### Technical Analysis Both Eastmoney API endpoints use plaintext HTTP. Consequently, the server cannot be authenticated through TLS and response integrity is not cryptographically protected. An attacker with a network position—such as a malicious Wi-Fi operator, compromised router, proxy, or upstream network actor—can intercept and alter the responses. The application parses the response as trusted JSON without checking the HTTP status, response content type, schema, numeric ranges, or source authenticity. Modified index values directly influence the calculated market sentiment, while modified sector values influence sector ordering and automatically generated focus, risk, and ca ...[truncated 1839 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace both API URLs with supported HTTPS endpoints: ```javascript const CONFIG = { eastmoneyBoardApi: 'https://push2.eastmoney.com/api/qt/clist/get', eastmoneyStockApi: 'https://push2.eastmoney.com/api/qt/stock/get', }; ``` 2. Reject plaintext URLs before issuing any request: ```javascript const parsedUrl = new URL(url); if (parsedUrl.protocol !== 'https:') { throw new Error('Only HTTPS endpoints are permitted'); } ``` 3. If redirects are implemented in the future, validate every redirect destination and reject HTTPS-to-HTTP downgrades. 4. Validate transport and response metadata: - Require an HTTP 2xx status. - Require an expected JSON content type. - Enforce a maximum response size. - Retain normal Node.js TLS certificate and hostname verification. 5. Validate the parsed response against a strict schema: - Require expected objects and fields. - Require finite numeric index and percentage values. - Apply reasonable length and range constraints. - Reject malformed or unexpected field types. 6. Escape untrusted text before embedding it in Markdown tables. At minimum, neutralize pipe characters, line breaks, and unsafe HTML or link syntax in board names. 7. Clearly label generated focus and risk statements as heuristic output rather than verified capital-flow or investment advice. ]]>
Vulnerability Patterns
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The skill advertises a complete daily A-share report with capital-flow information, but the document itself states that key fields such as northbound funds and margin balance are unavailable and fixed as '--', while other outputs like 'main inflow' and strategy text are inferred or static. This creates a trust and integrity issue: users may treat partially fabricated or incomplete financial information as real market data, leading to bad decisions in a finance context.

Ae1

High
Category
analysis-evasion
Content
node scripts/a-stock-report.js
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/a-stock-report.js
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/a-stock-report.js
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
node scripts/a-stock-report.js
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The skill description and user-facing instructions are entirely in Chinese and describe the generated report as an A股日报, with no indication that users may choose another language or locale. This constitutes a language/locale policy issue because the skill appears to require a specific language without opt-in or justification beyond the market domain.

Description-Behavior Mismatch

Medium
Confidence
90% confidence
Finding
The code generates investment-style advice such as position sizing, buy-low/sell-high guidance, and sector suggestions that are not grounded in robust analysis and go beyond neutral reporting. In a financial context, synthesized trading recommendations can cause users to act on unvetted guidance, creating integrity and compliance risk.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The report presents sections such as 北向资金, 融资余额, and 主力流入方向 as if they were part of a complete daily market brief, but these values are placeholders ('--') or derived heuristics rather than fetched source data. In a financial-reporting skill, this can mislead downstream users or agents into trusting incomplete or fabricated market data and making decisions based on false completeness.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This code generates all user-facing report content in Chinese and explicitly formats dates with the zh-CN locale. The policy requires offering a language or locale choice unless the locale restriction is clearly documented and justified, which is not present in this file.

Intent-Code Divergence

Low
Confidence
84% confidence
Finding
The top-level documentation understates the actual behavior and omits that some report sections are fabricated from heuristics or placeholders rather than direct data retrieval. This mismatch weakens transparency and can cause operators to overtrust the output, especially in automated pipelines that rely on the declared scope of the tool.

Static analysis

No suspicious patterns detected.