Back to skill

Security audit

A股综合分析报告

Security checks for vulnerabilities and agentic risk

Overview

The skill fits its A-share analysis purpose, but it generates browser-opened HTML from untrusted market/news text without escaping and also uses plaintext market-data endpoints, so it needs review before installation.

Install only in an isolated virtual environment or container, avoid running pip as root, and prefer pinned dependencies. Treat generated reports as untrusted HTML until escaping/CSP and HTTPS-only data fetching are fixed, and remember that stock queries and optional TUSHARE_TOKEN-backed requests go to external providers.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate_report.py:154
Finding

Unescaped Remote and Narrative Data Enables HTML Injection

Content
View full analysis
{p['name']}
{p.get('source','').split(':')[0]}" for p in peers ) peer_row = lambda fn: "".join(f"{fn(p)}" for p in peers) biz_rows = "" products = mbiz.get("by_product") or mbiz.get("by_industry") or [] for item in products[:5]: ratio = (item.get("revenue_ratio") or 0) * 100 if ratio < 1 and "其他" in item.get("item", ""): continue rev_yi = (item.get("revenue") or 0) / 1e8 gm = (item.get("gross_margin") or 0) * 100 biz_rows += ( f"{item['item']}{rev_yi:.2f}" f"{ratio:.1f}%{gm:.2f}%" ) cat_html = "" for c in n.get("catalysts", []): cat_html += ( f"
  • {c['title']} " f"{impact_badge(c.get('impact','中'))}:{c['desc']}
  • " ) risk_html = "" for r in n.get("risks", []): risk_html += ( f"
  • {r['title']} " f"{impact_badge(r.get('impact','中'))}:{r['desc']}
  • " ) ``` ```python # Representative output sinks from lines 316-496

    {n.get('company_comment','')}

    {n.get('price_position','')}

    按地区:{n.get('region_summary','-')}

    {n.get('business_comment','')}

      {"".join(f"
    • {f}
    • " for f in n.get('peer_findings', []))}
      {cat_html}
      {risk_html}

    {n.get('overall_judgment','')}

    ``` ### Technical Analysis The report generator constructs an HTML document using Python f-strings and directly in ...[truncated 2455 chars]
    Remediation
    View remediation
    ``` 7. Add regression tests containing `

    T09 · Insecure Skill Coding Practices

    Warning
    Location
    scripts/sources/eastmoney.py:245
    Finding

    Market Data and Search Queries Are Transmitted over Plaintext HTTP

    Content
    View full analysis
    Remediation
    View remediation

    T08 · Insecure Dependencies

    Warning
    Location
    SKILL.md:31
    Finding

    Unpinned Dependency Installation Creates a Supply-Chain Execution Risk

    Content
    View full analysis
    Remediation
    View remediation
    Vulnerability Patterns
    • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
    • Behavioral ASTexec() Call, eval() Call, Dynamic Import
    • 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
    Findings (20)

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    96% confidence
    Finding

    声明描述的是一个面向终端用户的A股综合分析技能,涵盖多维分析、图表、建议和触发条件控制。实际代码只是底层的基本面数据解析组件,负责从多个数据源按优先级获取 harmonized fundamental indicators,并在必要时用东方财富补字段。这属于报告系统中的支持性子模块,但就所给代码块本身而言,其主要行为与声明的完整功能范围相差很大。虽然代码所访问的数据源与A股基本面分析相关,并未出现明显越权或恶意能力,但它没有实现声明中的大部分核心能力,因此应判定为描述与行为不匹配。

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    93% confidence
    Finding

    The declared description promises a full A-share analysis/reporting skill with multiple analytical outputs and user-facing recommendations. The actual code chunk is a backend utility focused solely on selecting comparable peer stocks using Eastmoney board data and liquidity filtering. While peer selection could support the '同行业对比' portion of a larger report, this code by itself does not implement the primary declared functionality. There are no obvious unrelated malicious behaviors, but the actual behavior is materially narrower and different from the declared purpose.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    94% confidence
    Finding

    该代码片段的实际功能较窄,集中在技术分析可视化和指标计算,属于“综合分析报告”的一个组成部分,但远未覆盖描述中宣称的大部分核心能力。描述强调完整A股综合分析报告,包含行业对比、基本面、业务构成、评分、催化剂/风险、交易建议,以及特定触发条件;而代码中看不到任何数据抓取、行业比较、财务分析、文本报告拼装、建议生成或触发识别逻辑。因此描述明显高于代码实际行为,构成能力层面的不匹配。

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    94% confidence
    Finding

    声明描述的是一个面向终端用户的完整A股综合分析技能,而实际代码是一个数据源模块,主要负责从 akshare 拉取行业、概念、个股信息及部分财务指标。虽然其中的同行业对比和基本面数据获取与声明部分相关,但代码的实际职责明显更窄,缺少声明中大部分核心能力,尤其是技术分析图表、综合报告生成和投资建议输出。此外,声明强调仅对A股触发,但该代码并未实现任何触发或市场范围限制逻辑。因此,代码行为与技能声明存在实质性不一致。

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    97% confidence
    Finding

    声明描述的是一个完整的A股综合分析技能,而实际代码只是其中一个底层基本面数据抓取组件,功能范围明显更窄,主用途是从 baostock 获取季度财务指标。虽然它与“A股基本面分析”这一子能力相关,且仅处理A股代码格式,与声明领域并不冲突,但它并未实现声明中的大部分核心能力。因此就“该代码块实际做什么”与“技能描述”而言,存在显著不匹配:描述的是端到端分析报告技能,代码实现的是一个基础数据源辅助模块。

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    98% confidence
    Finding

    The description presents a high-level end-user analysis skill, but the code chunk is a low-level market data connector for Tencent Finance. Its actual functions are limited to HTTP requests, code normalization, historical daily OHLCV retrieval, and realtime quote parsing. Those are supporting data acquisition capabilities, not the declared end behavior of producing a comprehensive A-share analysis report. The module also explicitly supports index data (e.g., CSI 300, SSE, SZSE), whereas the declared purpose says it should only trigger for specific A-shares and not broad market commentary. While data fetching could be a component of such a skill, this code by itself materially under-implements and differs from the declared primary purpose.

    Content

    No source excerpt is available for this finding.

    Undeclared Tool Scope

    Medium
    Category
    MCP Least Privilege
    Confidence
    94% confidence
    Finding

    The skill instructs the agent to read files, write output, access environment variables, and perform network requests, but it does not declare any explicit tool scope or allowed-tools policy. This creates an over-privileged execution model where the runtime may grant broader access than users expect, increasing the blast radius if the skill is misused or its prompts are manipulated.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    90% confidence
    Finding

    The file consistently defines the skill in Chinese and specifies generation of an A-share analysis report following a Chinese template, but does not indicate that users may choose another language. Under the policy, forcing a specific language without opt-in is a natural-language locale violation unless clearly justified and documented as region-specific.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Medium
    Category
    Not specified by scanner
    Confidence
    94% confidence
    Finding

    The markdown instructs the agent to 반드시 perform web_search for recent announcements, clarifications, share-reduction news, and favorable news before writing the narrative JSON. This is a network action that may transmit user-provided stock identifiers and trigger external data access, but the user-facing skill description does not clearly warn about this behavior or its privacy implications.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    95% confidence
    Finding

    The file title and all report content are specified in Chinese, and the template defines a strict required output structure in that language. This imposes a specific language/locale on generated reports without indicating user choice or documenting a justified region-specific constraint.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    94% confidence
    Finding

    This markdown file presents all instructions and scoring guidance exclusively in Chinese, and there is no indication that users can opt into another language or that the skill is intentionally restricted to a Chinese-speaking context. Under the policy rule for natural-language violations, forcing a specific language without user opt-in is a reportable issue.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    91% confidence
    Finding

    The generated document forces lang="zh-CN", and the report content throughout the template is written in Chinese, with no option for users to select another language or locale. This is a natural-language locale policy concern because the skill imposes a specific language by default rather than offering opt-in or documenting a justified regional restriction.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Low
    Category
    Not specified by scanner
    Confidence
    91% confidence
    Finding

    This file embeds Chinese-only matching rules such as board-name patterns, suffixes, and concept keywords, which makes the skill effectively operate only in a specific language/market context. Under the policy, forcing a specific language or locale without user opt-in or explicit justification is a natural-language policy concern.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Low
    Category
    Not specified by scanner
    Confidence
    92% confidence
    Finding

    The file hardcodes Chinese text in the title format, which imposes a specific language/locale in generated output. Under the policy, locale-specific behavior should either offer user choice or be clearly documented as justified for a region-specific use case.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Low
    Category
    Not specified by scanner
    Confidence
    89% confidence
    Finding

    The function calls setup_chinese_font() and emits Chinese labels such as 沪深300, (目标), and 归一化价格(起始=100), which indicates mandatory Chinese presentation. There is no visible mechanism for user opt-in or locale selection, and no justification in the file that the skill is region-specific.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Low
    Category
    Not specified by scanner
    Confidence
    92% confidence
    Finding

    This code explicitly invokes setup_chinese_font, and the file also contains fixed Chinese UI text such as chart titles and labels. Because the skill forces a specific language/locale presentation without user opt-in or a documented region-specific justification in this file, it matches the natural-language locale policy concern.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Low
    Category
    Not specified by scanner
    Confidence
    90% confidence
    Finding

    This script calls external data sources (eastmoney and fallback akshare) to resolve user-provided stock identifiers, which transmits the user's query over the network. The file includes no confirmation prompt, print/log disclosure, or warning in comments/docstrings that user input will be sent to third-party services.

    Content

    No source excerpt is available for this finding.

    Dynamic attribute access via getattr()

    Low
    Category
    Dangerous Code Execution
    Confidence
    50% confidence
    Finding

    Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

    Content

    Scanner excerpt · scripts/sources/baostock_src.py (reported line 93)May include surrounding context.

    python
    def _latest_quarter(bs, method: str, code: str, year: int) -> Optional[dict]:
        """Query a baostock method for current & recent years, return most-recent non-empty quarter."""
        fn = getattr(bs, method)
        for y in (year, year - 1):
            for q in (3, 2, 1, 4):
                try:
    

    Missing User Warnings

    Low
    Category
    Not specified by scanner
    Confidence
    77% confidence
    Finding

    This code sends the user-provided search query to Eastmoney over HTTP in search_stocks, but there is no confirmation prompt, logging, or comment warning that user input will be transmitted to an external service. For code files, outbound network transmission of user or system data should have some visible disclosure unless clearly covered by the skill's stated purpose.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Low
    Category
    Not specified by scanner
    Confidence
    96% confidence
    Finding

    The code hardcodes the report name using Chinese text ("年", "一季报", "中报", "三季报", "年报") when constructing user-facing output. This imposes a specific language/locale choice with no indication that users can opt in, opt out, or request another locale.

    Content

    No source excerpt is available for this finding.

    Static analysis

    No suspicious patterns detected.