Back to skill

Security audit

stock-valuation-monitor

Security checks for vulnerabilities and agentic risk

Overview

The skill coherently provides China-market stock and ETF valuation analysis, with disclosed public market-data access, but exported spreadsheets and unpinned dependencies need care.

Install only if you are comfortable with the skill calling public Chinese market-data providers and installing the listed Python packages. Prefer a locked dependency set, and treat CSV/XLSX exports as externally sourced data: open them with spreadsheet external links and legacy formula features disabled, or sanitize formula-leading cells before sharing or opening in sensitive environments.

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
main.py:1571
Finding

Spreadsheet Formula Injection in CSV and Excel Exports

Content
View full analysis

Vulnerability Details

File Location: main.py, lines 1571-1652
Vulnerability Type: Spreadsheet formula injection
Risk Level: Medium

Vulnerable Code

python
def export_to_csv(self, results: List[ValuationResult]) -> str:
    """Export as CSV."""
    import csv
    import io

    output = io.StringIO()
    writer = csv.writer(output)

    headers = ['Code', 'Name', 'Type', 'Price', 'Change %', 'PE', 'PE Percentile',
               'PE Warning', 'PB', 'PB Percentile', 'PB Warning', 'ROE %',
               'ROE Rating', 'Valuation Zone', 'Suggestion', 'Data Source', 'Timestamp']
    writer.writerow(headers)

    for r in results:
        if not r.success or not r.basic_info:
            writer.writerow([r.code, '', '', '', '', '', '', '', '', '', '', '', '', r.message, '', ''])
            continue

        bi = r.basic_info
        pe_warning = r.pe.warning if r.pe else ''
        pb_warning = r.pb.warning if r.pb else ''

        writer.writerow([
            r.code,
            bi.name or '',
            'ETF' if r.asset_type == AssetType.ETF else 'Stock',
            bi.price if bi.price else '',
            bi.change_pct if bi.change_pct is not None else '',
            r.pe.current if r.pe else '',
            r.pe.percentile if r.pe else '',
            pe_warning,
            r.pb.current if r.pb else '',
            r.pb.percentile if r.pb else '',
            pb_warning,
            r.roe['current'] if r.roe else '',
            r.roe['level'] if r.roe else '',
            r.zone,
            r.suggestion,
            ','.join(r.data_sources),
            r.timestamp
        ])
python
def export_to_excel(self, results: List[ValuationResult]) -> Optional[bytes]:
    if not EXCEL_AVAILABLE:
        return None

    import io
    output = io.BytesIO()

    data = []
    for r in results:
        if not r.success or not r.basic_
...[truncated 3326 chars]
Remediation
View remediation

Remediation Suggestions

  1. Apply a centralized spreadsheet-sanitization function to every externally influenced string before CSV or Excel serialization.
  2. Treat values beginning with =, +, -, @, tab, carriage return, or line feed as unsafe.
  3. Prefix unsafe values with an apostrophe or otherwise force the destination cell to use an explicit text data type.
  4. Apply sanitization to all text fields, not only the stock name, so later changes do not introduce another unsafe export path.
  5. For XLSX output, explicitly configure external values as text cells rather than relying only on string transformation.
  6. Add regression tests for values such as =HYPERLINK(...), +cmd, -1+1, @SUM(...), tab-prefixed formulas, and carriage-return-prefixed formulas.
  7. Document that exported files contain externally sourced information and should be opened with external links and legacy formula features disabled.

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unbounded and Unhashed Third-Party Dependencies

Content
View full analysis

Vulnerability Details

File Location: requirements.txt, lines 1-5
Vulnerability Type: Dependency supply-chain and build-integrity weakness
Risk Level: Low

Vulnerable Code

text
requests>=2.28.0
pandas>=1.5.0
numpy>=1.21.0
akshare>=1.10.0
openpyxl>=3.0.0

Technical Analysis

Every dependency uses an open-ended minimum-version constraint. Consequently, installations performed at different times can resolve to different package versions, including future releases that were never reviewed or tested with this Skill.

The dependency specification also provides no cryptographic hashes. Package installers therefore cannot verify that an artifact matches a specifically reviewed distribution file. This is particularly relevant because imported Python packages execute code during import, and package installation can involve build backends or setup logic.

akshare is especially security-relevant because it is a substantial network-facing dependency used to retrieve and process external financial data. No evidence was found that any currently declared package is intentionally malicious; this finding concerns the absence of reproducible and integrity-verified dependency resolution.

Attack Path

  1. A dependency publisher account, package-index artifact, or upstream release process is compromised, or a future unsafe release is published.
  2. An operator installs the Skill using requirements.txt.
  3. The open-ended version constraint permits the installer to select the affected release.
  4. Because no artifact hashes are required, installation proceeds without verifying the package against a reviewed artifact.
  5. Malicious package code executes during installation, build processing, or import.
  6. The package obtains the same privileges and data access as the process installing or running the Skill.

Impact Assessment

Successful supply-chain exploitation could execute arbitra ...[truncated 498 chars]

Remediation
View remediation

Remediation Suggestions

  1. Generate and commit a lock file containing exact, reviewed dependency versions.
  2. Require cryptographic hashes for all distributions, for example by using a hash-locked requirements file and installation with hash verification enabled.
  3. Separate optional packages such as akshare and openpyxl from mandatory runtime dependencies so deployments install only required components.
  4. Prefer binary wheels from trusted indexes and restrict package installation to explicitly approved repositories.
  5. Run automated vulnerability and dependency-integrity scanning as part of release validation.
  6. Update locked versions through a controlled review process that includes compatibility tests and release-note inspection.
  7. Install and run the Skill under a dedicated, least-privileged account or container to limit the impact of a dependency compromise.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (14)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill declares external data sources and Python dependencies that imply network access, but it does not declare any explicit tool scope or permissions boundary. This creates an authorization and review gap: an agent runtime may permit broader-than-necessary outbound access, making data exfiltration, unexpected third-party calls, or supply-chain exposure harder to detect and constrain.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest description and nearly all user-facing instructions are written exclusively in Chinese, and the example invocations assume Chinese-language prompts. There is no statement that the skill is China-specific only, nor any opt-in or alternative language support, which creates a natural-language locale policy concern under the language-choice rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file’s user-facing natural-language descriptions and examples are predominantly in Chinese, and the request/response messages returned by the skill are also Chinese-only. There is no indication that users may choose their preferred language or locale, which can violate a language/locale policy requiring opt-in or choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

All user-facing status, error, example, and suggestion strings in the handler are hard-coded in Chinese. Because the skill does not offer a language choice or clearly justify a mandatory Chinese locale, this is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger list includes generic investment terms such as “投资机会” and “风险评估”, which can cause the skill to activate for broad finance discussions unrelated to stock valuation. In a finance skill, unintended activation is risky because the agent may inject investment-oriented outputs into conversations without clear user intent, increasing the chance of inappropriate financial guidance or data handling.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The manifest describes a stock/ETF valuation monitoring tool focused on PE/PB band and historical percentile assessment. In addition to analysis, the code implements multi-format export features (JSON/CSV/Excel) and returns full file content for Excel exports, which goes beyond pure monitoring behavior.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The dependency is specified with a lower-bound only (requests>=2.28.0), which makes builds non-reproducible and allows future installs to resolve to unexpected releases. This increases supply-chain risk and makes it hard to determine whether a deployed environment contains a vulnerable or breaking version of requests.

Content

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

text
requests>=2.28.0
pandas>=1.5.0
numpy>=1.21.0
akshare>=1.10.0  # 可选,用于历史数据

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
94% confidence
Finding

requests has known advisories, but the manifest does not pin the installed version, so it is impossible to verify whether the runtime will avoid affected releases. In a tool that likely performs network access for market data retrieval, uncertainty around HTTP client security is relevant because vulnerable versions could expose credentials, request integrity, or transport behavior.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

Using pandas>=1.5.0 without an upper bound or exact pin allows dependency resolution to drift over time. That weakens reproducibility and may silently introduce vulnerable or incompatible versions into the skill environment.

Content

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

text
requests>=2.28.0
pandas>=1.5.0
numpy>=1.21.0
akshare>=1.10.0  # 可选,用于历史数据
openpyxl>=3.0.0  # 可选,用于Excel导出

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
88% confidence
Finding

Because pandas is not version-pinned, the environment may resolve to a release with known security issues or incompatible behavior, and the manifest gives no way to verify safety. While the cited advisory is narrower and context-dependent, the lack of pinning still leaves the deployment posture uncertain.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

The unpinned numpy>=1.21.0 declaration permits installation of any later release, including versions that may later receive advisories or break expected behavior. This creates a supply-chain and maintenance risk even if no immediate exploit is present in the manifest itself.

Content

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

text
requests>=2.28.0
pandas>=1.5.0
numpy>=1.21.0
akshare>=1.10.0  # 可选,用于历史数据
openpyxl>=3.0.0  # 可选,用于Excel导出

Unverifiable Dependency: numpy has 16 known advisory(ies) (CVE-2014-1859 (Numpy arbitrary file write via symlink attack); CVE-2021-41495 (NumPy NULL Pointer Dereference); CVE-2021-33430 (NumPy Buffer Overflow (Disputed)) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

numpy has published advisories, and the absence of an exact version means the installed package could be either safe or affected with no verifiable guarantee from this file alone. This is primarily a supply-chain hygiene issue rather than evidence of active exploitation in the skill.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: openpyxl has 2 known advisory(ies) (CVE-2017-5992 (Improper Restriction of XML External Entity Reference in Openpyxl); CVE-2017-5992 (Openpyxl 2.4.1 resolves external entities by default, which allows remote attack)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

openpyxl is optional, but if installed its unpinned version cannot be verified against known advisories such as historical XXE-related issues. In a skill that may export Excel files, this is less dangerous than direct network-facing code, but it still represents uncertain dependency risk if spreadsheet parsing or XML handling is used.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

Natural-language fields such as the description, trigger phrases, and example descriptions are written exclusively in Chinese, but the manifest does not state that the skill is limited to Chinese-speaking users or a China-specific deployment context. This can violate language/locale policy if the environment expects user choice rather than a forced language.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.