Back to skill

Security audit

AI Stock Research Team

Security checks for vulnerabilities and agentic risk

Overview

The stock-analysis skill mostly matches its stated purpose, but it ships scripts that can persistently change AI-client MCP configuration and, if run, publish the whole repository to a public GitHub repo.

Install only if you are comfortable with a setup script that installs Python packages and persistently registers a local MCP server in your AI client. Review setup.sh before running it, avoid running publish.sh unless you intentionally want to create and push a public GitHub repository, and treat generated financial reports as informational rather than investment advice.

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)

T08 · Insecure Dependencies

Warning
Location
references/requirements.txt:1
Finding

Unpinned Executable Dependencies Allow Supply-Chain Drift

Content
View full analysis
=1.0.0 akshare>=1.14.0 yfinance>=0.2.40 ``` `scripts/setup.sh:101-108`: ```bash info "安装 Python 依赖..." if command -v uv &>/dev/null; then uv pip install --python "$VENV_PYTHON" -r "$REQUIREMENTS" else "$VENV_PYTHON" -m pip install --upgrade pip -q "$VENV_PYTHON" -m pip install -r "$REQUIREMENTS" -q fi ``` ### Technical Analysis All three dependencies use minimum-version constraints rather than exact, reviewed versions. Consequently, each installation can resolve a different dependency graph, including future releases that were not part of this audit. The installation process also lacks package hashes or another integrity-verification mechanism. Python packages and their transitive dependencies may execute build-backend or installation-related code during resolution and installation. They are subsequently imported by the MCP server, allowing malicious runtime initialization code to execute as well. This creates a supply-chain exposure if an allowed upstream release or transitive dependency is compromised. The README additionally recommends `npx clawhub@latest`, which similarly resolves a mutable package version, although the confirmed Python dependency issue is directly represented by the requirements file and setup script. ### Attack Path 1. An attacker compromises one of the permitted Python packages, its distribution account, or a transitive dependency. 2. A malicious version is published with a version satisfying the broad `>=` constraint. 3. A user runs `scripts/setup.sh`. 4. `pip` or `uv` resolves and downloads the malicious version because no exact lock or hash restricts it. 5. Malicious code executes du ...[truncated 930 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
assets/report-template.html:890
Finding

Unsanitized Report Data Is Inserted Through innerHTML

Content
View full analysis
`
  • ${p}
  • `).join(''); } if (data.bearPoints) { document.getElementById('bear-points').innerHTML = data.bearPoints.map(p => `
  • ${p}
  • `).join(''); } if (data.debateResult) document.getElementById('debate-result').innerHTML = '⚖️ ' + data.debateResult; // Conclusion if (data.conclusion) document.getElementById('conclusion-text').innerHTML = data.conclusion; ``` ### Technical Analysis The `renderReport(data)` function inserts `bullPoints`, `bearPoints`, `debateResult`, and `conclusion` into the document using `innerHTML`. These values are neither escaped nor sanitized before the browser parses them as markup. If any field contains attacker-controlled HTML, the supplied content can introduce arbitrary elements and event-handler attributes. For example, a payload containing an image element with an error handler could run JavaScript when the browser renders the report. The risk is especially relevant if report data incorporates model-generated text, external financial/news content, or user-controlled company names and commentary without a strict trust boundary. Other fields in the same function use `textContent`, demonstrating that HTML parsing is not necessary for most report values. ### Attack Path 1. An attacker causes malicious markup to enter a report field, such as a bullish point, bearish point, debate result, or conclusion. 2. The application or user passes that field to `renderReport(data)`. 3. The renderer assigns the value to an element’s `innerHTML`. 4. The browser parses the value as active HTML rather than plain text. 5. An injected event handler or equivalent browser-supported payload executes in the report document’s origin. ...[truncated 1086 chars]
    Remediation
    View remediation
    Vulnerability Patterns
    • 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
    • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
    Findings (35)

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    99% confidence
    Finding

    Behavior that deletes virtual environments, edits MCP configuration files, or unregisters servers is materially unrelated to end-user stock analysis and can alter or damage the local agent environment. In this context, hidden install/uninstall or cleanup actions increase the risk of persistence changes, denial of service, and confusing side effects outside the skill’s stated purpose.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    95% confidence
    Finding

    Behavior that deletes virtual environments, edits MCP configuration files, or unregisters servers is materially unrelated to end-user stock analysis and can alter or damage the local agent environment. In this context, hidden install/uninstall or cleanup actions increase the risk of persistence changes, denial of service, and confusing side effects outside the skill’s stated purpose.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    99% confidence
    Finding

    Behavior that deletes virtual environments, edits MCP configuration files, or unregisters servers is materially unrelated to end-user stock analysis and can alter or damage the local agent environment. In this context, hidden install/uninstall or cleanup actions increase the risk of persistence changes, denial of service, and confusing side effects outside the skill’s stated purpose.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    High
    Category
    Not specified by scanner
    Confidence
    99% confidence
    Finding

    The script creates a public GitHub repository and pushes content without an explicit warning that the upload is public or that data exposure may be irreversible once indexed or cloned. Because it runs under the user's authenticated GitHub CLI session, a single execution can publish the entire repository contents broadly and immediately.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Medium
    Category
    Not specified by scanner
    Confidence
    87% confidence
    Finding

    The README advertises real-time stock analysis via MCP tools backed by akshare and yfinance, but it does not warn users that their queried tickers and related requests may be sent to external data providers or services. In a finance-oriented workflow, query patterns can reveal user interests, strategies, or sensitive research activity, so omission of this disclosure creates a privacy and transparency risk.

    Content

    No source excerpt is available for this finding.

    Rp1

    Medium
    Category
    MCP Rug Pull
    Confidence
    88% confidence
    Finding

    The README instructs users to run npx clawhub@latest install stock-research-team, which pulls and executes the latest package version at install time rather than a reviewed, pinned release. This creates a supply-chain risk: if the upstream package is compromised or a breaking/malicious update is published, users may execute untrusted code during installation.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Medium
    Category
    Not specified by scanner
    Confidence
    93% confidence
    Finding

    The README tells users to run setup and later uninstall shell scripts that create virtual environments, install packages, and register/remove an MCP server, but it does not clearly warn about the system changes these scripts perform. This increases the risk of users executing impactful local changes without informed consent, especially because shell scripts can modify files, environment configuration, and tool registrations.

    Content

    No source excerpt is available for this finding.

    Rp1

    Medium
    Category
    MCP Rug Pull
    Confidence
    88% confidence
    Finding

    The uninstall command also uses npx clawhub@latest, which again relies on an unpinned executable fetched at runtime. Although this is an uninstall path, it still executes code from the network and could be abused via a compromised upstream release or dependency chain.

    Content

    No source excerpt is available for this finding.

    Undeclared Tool Scope

    Medium
    Category
    MCP Least Privilege
    Confidence
    91% confidence
    Finding

    The skill requests users to run a local setup script and declares no explicit tool scope or permissions, while the package appears to include file read/write capabilities. In an agent ecosystem, missing scope declarations reduce transparency and can permit broader-than-expected local file operations during setup or execution, which is risky for a stock-analysis skill that should not need unrestricted filesystem access.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    89% confidence
    Finding

    The skill is defined entirely as a Chinese-language experience and does not state that the user may choose another language. This creates a language/locale policy concern because the skill appears to enforce a specific language without explicit user opt-in or an offered alternative.

    Content

    No source excerpt is available for this finding.

    Vague Triggers

    Medium
    Category
    Not specified by scanner
    Confidence
    92% confidence
    Finding

    The activation description includes broad natural-language phrases like "帮我看看 XXX 这只股票" and "XXX 值不值得买", which are common conversational requests rather than tightly scoped commands. Because the skill does not provide exclusion conditions or clearer trigger boundaries, this could cause unintended invocation during ordinary discussion about stocks.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    95% confidence
    Finding

    The document hard-codes lang="zh-CN", and the visible interface text throughout the template is fixed in Simplified Chinese. This imposes a specific language/locale on users without offering opt-in, fallback, or explaining that the skill is intentionally region-specific.

    Content

    No source excerpt is available for this finding.

    Intent-Code Divergence

    Medium
    Category
    Not specified by scanner
    Confidence
    98% confidence
    Finding

    The template’s script injects untrusted data into the DOM with innerHTML for bullPoints, bearPoints, debateResult, and conclusion. If any of these fields are derived from LLM output, MCP tool results, or user-controlled stock/report content, an attacker can inject arbitrary HTML/JavaScript, leading to stored or reflected XSS in the generated report.

    Content

    No source excerpt is available for this finding.

    Context-Inappropriate Capability

    Medium
    Category
    Not specified by scanner
    Confidence
    96% confidence
    Finding

    The script performs GitHub authentication, creates a repository, and pushes local contents to a public remote, which is unrelated to the runtime purpose of a stock research skill. In this context, bundling publication behavior increases supply-chain and data-exposure risk because users may run a convenience script that unexpectedly publishes all local skill files under their authenticated GitHub account.

    Content

    No source excerpt is available for this finding.

    Description-Behavior Mismatch

    Medium
    Category
    Not specified by scanner
    Confidence
    96% confidence
    Finding

    The script stages all files, commits them, and publishes them to a public GitHub repository, behavior that does not match the declared stock-analysis functionality of the skill. This mismatch is dangerous because users evaluating a financial-analysis skill would not reasonably expect repository publication logic, making accidental disclosure of source, secrets, or local artifacts more likely.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Medium
    Category
    Not specified by scanner
    Confidence
    98% confidence
    Finding

    Using git add -A and committing immediately captures every tracked and untracked file in the directory without user review or confirmation. This can inadvertently include credentials, local notes, build artifacts, or environment files, creating a straightforward path to accidental sensitive-data publication once the later push step runs.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Medium
    Category
    Not specified by scanner
    Confidence
    92% confidence
    Finding

    Natural-language descriptions and tool documentation in this file consistently force Chinese-language output and interaction context, with no indication that users may choose another language. Under the stated policy, mandating a specific language without opt-in is a locale/language policy violation.

    Content

    No source excerpt is available for this finding.

    Sudo/Root Execution

    Medium
    Category
    Privilege Escalation
    Confidence
    70% confidence
    Finding

    Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

    Content

    Scanner excerpt · scripts/setup.sh (reported line 68)May include surrounding context.

    sh
    echo ""
        echo "  请安装 Python 3.10+:"
        echo "    macOS:  brew install python@3.12"
        echo "    Ubuntu: sudo apt install python3.12 python3.12-venv"
        echo "    通用:   https://www.python.org/downloads/"
        echo ""
        exit 1
    

    Description-Behavior Mismatch

    Medium
    Category
    Not specified by scanner
    Confidence
    95% confidence
    Finding

    The setup script modifies host MCP client configuration files and registers a server automatically, which exceeds simple local environment setup for a stock-analysis skill. This is risky because it changes persistent client behavior on the user's machine and expands the skill's execution surface without explicit confirmation or narrowly scoped consent.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Medium
    Category
    Not specified by scanner
    Confidence
    97% confidence
    Finding

    The script writes directly to user MCP configuration files without prior confirmation, backup, or an explicit warning that persistent client settings will be changed. Silent modification of trusted tool configuration is dangerous because it can cause an AI client to start invoking new local code paths the user did not intentionally authorize.

    Content

    No source excerpt is available for this finding.

    Intent-Code Divergence

    Medium
    Category
    Not specified by scanner
    Confidence
    90% confidence
    Finding

    The header comment states the script removes stock-analyzer, which conflicts with the declared skill name stock-research-team. Misleading uninstall metadata increases the chance that maintainers or users run the script under false assumptions, leading to removal of unrelated configuration entries and making review of the script less reliable.

    Content

    No source excerpt is available for this finding.

    Description-Behavior Mismatch

    Medium
    Category
    Not specified by scanner
    Confidence
    96% confidence
    Finding

    The uninstall script belongs to the stock-research-team skill but removes an MCP server named stock-analyzer. This mismatch can cause the script to alter or break a different tool installation than the one the user intended to remove, especially in an environment where multiple skills or MCP servers coexist.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Medium
    Category
    Not specified by scanner
    Confidence
    95% confidence
    Finding

    The script performs rm -rf on a virtual environment directory without interactive confirmation or a dry-run warning. Although the target path is quoted and derived from the script location, recursive deletion is still destructive and could remove data unexpectedly if the directory layout is not what the user expects or if the script is launched from a tampered installation.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Medium
    Category
    Not specified by scanner
    Confidence
    89% confidence
    Finding

    The script edits MCP configuration files in place and may remove entries automatically via CLI or direct JSON rewriting, without clear up-front notice, backup, or confirmation. This can unexpectedly change user environment configuration and break other workflows, especially because the server name mismatch raises the risk of deleting the wrong entry.

    Content

    No source excerpt is available for this finding.

    Rp1

    Medium
    Category
    MCP Rug Pull
    Confidence
    70% confidence
    Finding

    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

    Content

    No source excerpt is available for this finding.

    Static analysis

    No suspicious patterns detected.