Back to skill

Security audit

Sun Yuchen's stock selection model

Security checks for vulnerabilities and agentic risk

Overview

This A-share market research skill mostly does what it claims, but it silently inserts an unrelated Content Science brand into user-facing reports and stores generated data locally.

Review this skill before installing if you need neutral or white-label output. It fetches public financial/news data from external services, may send your sector/search terms to those services, writes generated JSON snapshots under .local, and currently adds Content Science branding to reports by default. No destructive actions, credential harvesting, remote payload execution, or system persistence were found.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T01 · Skill Instruction Hijacking

Error
Location
scripts/generate_brief.js:133
Finding
Mandatory Undeclared Branding in Agent-Delivered Reports<![CDATA[ ## Vulnerability Details **File Location**: `scripts/generate_brief.js:133, 287, 296, 305, 314, 322`; execution and direct-delivery instructions at `SKILL.md:36-47` **Vulnerability Type**: T01: Skill Instruction Hijacking **Risk Level**: High ### Vulnerable Code ```javascript // Sector report L.push(`内容科学|Content Science`); L.push(`📊 ${data.description} · 板块研报`); // ... L.push(`— 内容科学|Content Science · 以上内容由 AI 基于公开数据生成,仅供参考,不构成投资建议 —`); ``` ```javascript // AI news report L.push('内容科学|Content Science'); L.push('📊 AI 股票内参简报'); // ... L.push('— 内容科学|Content Science · 仅供参考,不构成投资建议 —'); ``` ```javascript // Market-monitor report L.push('内容科学|Content Science'); L.push('🔔 AI 概念股异动提醒'); // ... L.push('— 内容科学|Content Science · 仅供参考,不构成投资建议 —'); ``` The relevant Skill workflow at `SKILL.md:36-47` requires the Agent to execute the generator and directly send the resulting Markdown to the user: ```markdown node scripts/generate_brief.js --mode sector --sector <sector-name> --output pretty ``` The workflow then instructs the Agent to send the generated Markdown directly, splitting it only when required by the platform's message-size limit. ### Technical Analysis Every report builder in `generate_brief.js` unconditionally inserts the `Content Science` brand at both the beginning and end of its output. This behavior affects sector reports, AI news reports, and market-monitor reports. The branding is unrelated to the technical requirements of retrieving market data, mapping stocks, detecting market movements, or generating analysis. It is also absent from the fixed report layout declared in `SKILL.md`. Because the Skill instructs the Agent to send the generated Markdown directly, the Agent is made to reproduce the undeclared branding during ordinary use. This is a form of output-oriented Skill instruction hijacking: loading and following the Skill changes the Agent's final response by adding persistent promotional attribution that the user did n ...[truncated 1312 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the hardcoded branding statements at lines 133, 287, 296, 305, 314, and 322. 2. Retain only neutral report titles and a generic investment-risk disclaimer. 3. If attribution is legitimately required, disclose it clearly in `SKILL.md` and make it configurable or opt-in. 4. Do not instruct the Agent to forward generated content without review. Require the Agent to verify that output contains only requested report content. 5. Add automated tests asserting that default output does not contain undeclared brands, advertisements, tracking links, referral material, or unrelated calls to action. 6. Separate report content from optional presentation metadata, for example: ```javascript function addAttribution(lines, attribution) { if (attribution) lines.push(attribution); } ``` The default value should be empty, and any attribution should require explicit user or deployer configuration. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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 (24)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The declared description presents an analytics/research skill for A-share sectors, including mapping global news to A-share impacts, judging sector trends, analyzing U.S. market relationships, and identifying positive/negative catalysts. The supplied code instead performs a much narrower task: collecting AI-related news from Tavily or a fixed list of AI/tech news webpages, then deduplicating and keyword-ranking the articles into JSON output. Although this could be a supporting input component for a larger research workflow, the chunk itself does not implement the core promised behaviors. Its primary purpose is news retrieval for AI topics, not A-share board/sector real-time research. Therefore the description materially overstates and misrepresents the actual behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The declared description promises a fairly sophisticated research capability involving cross-market mapping, analytical judgments, sentiment/impact labeling, and event reminders. The supplied code does not implement those behaviors. It simply accepts a sector name, queries a single Eastmoney search endpoint for related articles, normalizes the returned text, deduplicates results, and prints JSON. While fetching sector-related news is tangentially relevant, the primary purpose is materially narrower than the declared skill. Therefore this is a description-behavior mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding
The description promises a broad real-time A-share research capability spanning global-news mapping, trend judgment, U.S. market linkage, positive/negative impact analysis, and event reminders. The supplied code is much narrower: it only handles one subtask, fetching U.S.-related information for a given sector using hardcoded mappings and Eastmoney search results. It does not analyze trends, classify news as利好/利空, perform alerting, or format output for multiple platforms. While the declared description mentions U.S. linkage and event reminders, this code only partially supports the U.S.-linkage portion and a basic event list. Therefore the declared description materially overstates the implemented behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The code implements only a narrow subset of the declared description: keyword-based global-news-to-A-share candidate mapping. It does not perform sector trend analysis, sentiment/bullish-bearish evaluation, U.S. stock relationship analysis beyond simple keyword mappings, major event alerting, or report generation/formatting for Feishu, Coze, or Markdown. It also is not inherently real-time; it simply processes provided input. Therefore the declared description materially overstates the skill’s actual behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The declared description promises a broad real-time A-share sector research tool driven by global news, with mapping from news to A-shares, board trend assessment, U.S. market linkage, sentiment classification, and major event reminders. The supplied code does none of that. It is a market monitor for a fixed watchlist of AI-related A-share stocks and indices using a single Eastmoney quote API. Its core functions are fetching prices/change percentages, formatting grouped output, and generating alerts when percentage moves exceed a threshold. While both involve A-share market information and sector grouping, the actual behavior is materially narrower and different in primary purpose: quote monitoring and anomaly alerting, not news-driven research or cross-market analysis.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding
The declared description presents a broader real-time research capability centered on news analysis, cross-market mapping, event detection, and platform-ready output. The code only performs sector lookup and market-data retrieval for predefined A-share sectors using Eastmoney APIs, then formats top gainers/losers. While this partially aligns with '板块趋势' analysis in a very narrow sense, it does not implement the key advertised features: global news mapping, U.S. market linkage,利好利空 interpretation, or major event reminders. It is also a standalone command-line tool rather than a zero-config multi-platform output integration.

Ae1

High
Category
analysis-evasion
Content
node scripts/generate_brief.js --mode sector --sector <板块名> --output pretty
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill advertises executable workflows that invoke local Node.js scripts and optionally consume an API key, but it does not declare an explicit tool/permission scope. That creates a governance gap: a host agent may permit network and environment access without the manifest making those capabilities transparent, increasing the chance of over-broad execution or policy bypass.

Vague Triggers

Medium
Confidence
84% confidence
Finding
The trigger phrases are extremely broad and overlap with ordinary market conversation, making unintended activation likely. In an agent environment, accidental routing to a network-enabled skill can cause unnecessary external requests, unexpected script execution, and user confusion about when data is being fetched or transformed.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The prompt is entirely framed in Chinese and specifies a Chinese-market analysis format focused on A-shares, but it does not provide any user opt-in or language-selection mechanism. Under the policy, forcing a specific language or locale without user choice is a natural-language policy violation unless the constraint is clearly justified and documented.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
This markdown file contains user-facing operational guidance exclusively in Chinese, and there is no indication that the skill offers multilingual support, user opt-in, or a documented region-specific reason for the language constraint. Under the stated policy, forcing a specific language without user choice is a natural-language policy violation.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The document is entirely written in Chinese and provides no indication that users may choose another language or that the skill is intended only for a China-specific audience. Under the policy rule for language or locale constraints, this can constitute a natural-language policy violation when no opt-in or justification is stated.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The manifest describes a skill focused on 'A股板块实时研报', global-news-to-A-share mapping, sector trend judgment, U.S. stock linkage, sentiment, and event alerts. This script only fetches generic AI news/search results, deduplicates them, and keyword-scores relevance; it does not implement A-share mapping, board/sector analysis, U.S.-to-A-share linkage logic, or alert generation.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The file header, description, and command usage comments are presented in Chinese only, which imposes a specific language on users and maintainers. The file does not indicate that Chinese is optional, nor does it justify a region-specific constraint.

External Transmission

Medium
Category
Data Exfiltration
Content
*   node fetch_news.js --source tavily|web      # 强制指定数据源
 */

const TAVILY_ENDPOINT = 'https://api.tavily.com/search';

// ── 免费数据源 URL 列表 ──────────────────────────────────────────────
const FREE_SOURCES = [
Confidence
88% confidence
Finding
The script sends user-supplied or predefined search queries and retrieves content from third-party external services, including Tavily and multiple news websites. This creates data-transmission and supply-chain risk: sensitive queries could be disclosed to external providers, and untrusted remote content is ingested into downstream agent workflows where it could influence later analysis or prompt behavior.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file’s user-facing documentation is written only in Chinese and the script is designed around Chinese-language output and examples, which effectively forces a specific language experience without offering a language choice. This matches the language/locale policy concern because there is no opt-in or documented justification for restricting the skill to Chinese.

Context-Inappropriate Capability

Medium
Confidence
88% confidence
Finding
The manifest describes a stock research/reporting tool, but this implementation uses child_process to launch other scripts as part of its operation. While orchestration can be an implementation choice, spawning subprocesses is a more powerful capability than the stated user-facing purpose suggests and is not declared in the manifest context.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The file-level comments state that the script 'only outputs A-share candidates' and is 'suitable for Chinese user scenarios' while 'avoiding U.S. stocks.' This imposes a specific market/locale scope by default rather than offering the user a choice, which matches the policy concern about forcing a locale-specific behavior without opt-in.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The report timestamp is explicitly formatted with the 'zh-CN' locale and Asia/Shanghai timezone, and the rest of the user-facing strings throughout the script are only in Chinese. This forces a specific language/locale experience without user opt-in, which matches the policy-violation category for locale constraints.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
The natural-language instructions, examples, and output requirements are all presented in Chinese, with no indication that users may choose another language. This can constitute a language/locale policy issue because it implicitly forces a specific language without user opt-in.

Natural-Language Policy Violations

Low
Confidence
92% confidence
Finding
Natural-language policy violations apply to all file types, including code comments and usage strings. Here, the descriptive comments and example usage are presented solely in Chinese, with no opt-in, alternative locale, or indication that the skill is intentionally region-specific.

Description-Behavior Mismatch

Low
Confidence
84% confidence
Finding
The manifest frames the skill as producing real-time A-share research briefs and compatible formatted output, which implies data retrieval and report generation. However, this file also writes analysis results to timestamped files under .local as a persistent side effect, which is not reflected in the description and goes beyond simple output rendering.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
The code explicitly formats time using the zh-CN locale and Asia/Shanghai timezone, imposing a specific locale on all users. Because there is no user choice or documented region-specific constraint, this is a natural-language locale policy violation under the stated rules.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
The code explicitly formats time using the zh-CN locale and Asia/Shanghai timezone, while the script comments and console output are also fixed in Chinese. This creates a natural-language locale constraint without offering the user any language or locale selection, which matches the policy-violation criteria.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/fetch_news.js:198