Back to skill

Security audit

Agent Stock Pro

Security checks for vulnerabilities and agentic risk

Overview

The skill is a stock-analysis assistant, but it needs review because it can install packages, persist simulated trading state, and automatically send financial reports without clear confirmation steps.

Review this skill carefully before installing. It is not evidence of malware, but users should only run it in an environment where package installation, live stock lookups, local financial record retention, simulated portfolio mutation, and automatic report sending are acceptable. Prefer explicit confirmation before installs, file writes, simulated trades, scheduled runs, or sending PDFs externally.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:68
Finding

Unpinned Third-Party Packages Are Installed Without Integrity Verification

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 68-85
Vulnerability Type: Unverified and unpinned dependency installation
Risk Level: Medium

Vulnerable Code

markdown
If the command is not installed, install the `stock` command-line tool:

**uv:**
```bash
uv tool install agent-stock

pip:

bash
pip3 install agent-stock

If the user does not have uv or pip, first install a Python environment and then install the agent-stock package with pip.

weasyprint is also required to generate PDF reports:

bash
pip3 install weasyprint
text

### Technical Analysis

The setup procedure instructs the agent to install `agent-stock` and `weasyprint` without fixed versions, dependency hashes, a lockfile, signature verification, or an explicitly trusted package index. Package resolution therefore depends on mutable third-party registry state at the time the Skill runs.

Package installation can execute package-controlled build or installation logic. The installed tools and their transitive dependencies are also imported or executed later during normal Skill operation. Consequently, compromise of a package release, maintainer account, registry, or transitive dependency could turn this setup process into arbitrary code execution.

The instruction to install a Python environment when no package manager is available further broadens the setup operation without defining a trusted source, approved installation procedure, or required user authorization.

### Attack Path

1. An attacker compromises a referenced package, one of its transitive dependencies, or the registry account used to publish it.
2. The attacker publishes a malicious version while retaining a version number that satisfies the unrestricted installation request.
3. A user invokes the Skill on a system where the required dependency is absent.
4. The agent follows `SKILL.md` and runs `uv tool install agent-
...[truncated 1296 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin every direct dependency to a reviewed, immutable version, for example:

    bash
    uv tool install "agent-stock==<reviewed-version>"
    pip3 install "weasyprint==<reviewed-version>"
    
  2. Maintain a lockfile covering all transitive dependencies and review dependency changes before updating it.

  3. Require cryptographic hashes for downloaded distributions, such as a hash-locked requirements file installed with:

    bash
    pip3 install --require-hashes -r requirements.txt
    
  4. Explicitly configure an approved package index and disable unintended fallback indexes to reduce dependency-confusion exposure.

  5. Prefer verified release artifacts and package provenance or signatures where the package ecosystem supports them.

  6. Install dependencies in an isolated virtual environment or restricted container rather than the agent's global Python environment.

  7. Run installation with the least-privileged account and never automatically elevate with administrator or root privileges.

  8. Ask for explicit user confirmation before installing software or creating a Python environment. Show the package names, exact versions, source registry, and expected permissions.

  9. Separate dependency setup from ordinary stock-analysis execution so routine invocations cannot silently introduce new package versions.

  10. Add automated vulnerability, provenance, and software-bill-of-materials checks for direct and transitive dependencies.

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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (19)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs the agent to automatically perform simulated buys and sells, update a portfolio, and append trade records based on its own recommendations, without requiring explicit user confirmation. Even though the trades are labeled simulated, autonomous financial actions and persistent record changes can mislead users, create unauthorized state transitions, and normalize unsafe automation patterns in a finance context.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill directs generation of a PDF and automatic transmission to the current WeChat user without an explicit privacy or data-sharing warning. Reports may contain sensitive financial preferences, holdings, strategy details, or account-like portfolio history, so automatic outbound delivery increases the risk of unintended disclosure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description advertises trading decision support, scheduled tasks, and PDF sending, but provides no user-facing warning that outputs may influence financial decisions or be delivered automatically. In combination, automation and finance raise the risk of users relying on unattended, stale, or insufficiently reviewed recommendations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The overall purpose statement says the skill helps query market data, analyze it, and provide trading decisions, but does not clearly distinguish informational analysis from actionable financial advice. This ambiguity is risky because it may encourage the agent to present high-stakes recommendations without proper limitations, disclosures, or user-intent checks.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The workflow triggers are broad and map user intents like stock picking, trading decisions, holdings analysis, and strategy tracking to referenced documents without clear limits, exclusions, or required confirmations. In a financial domain, vague activation boundaries can cause the agent to over-apply the skill to general investment requests or move into higher-risk advisory behavior than the user intended.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly instructs the agent to help install Python and packages on the user's system, which exceeds a stock-analysis skill's core purpose and can lead to unauthorized environment modification. Even though the commands are common package-install steps, expanding from analysis into system administration increases the chance of unsafe changes, supply-chain exposure, and user-impacting side effects.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire instruction set is written to require operation and output in Chinese, with no indication that users may choose another language. Per the policy, forcing a specific language without opt-in is a natural-language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to persist detailed holdings analysis to a local file without requiring user consent, notice, or any data-minimization guardrails. Because holdings data can include sensitive financial information, silent local persistence increases the risk of unintended retention, later disclosure, or reuse by other tools/processes on the host.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill hard-codes Chinese-only behavior across the full workflow and output template without any user language selection or consent. This can cause unsafe misunderstandings, reduce user ability to verify high-risk trading instructions, and undermine accessibility or policy-compliant disclosure in the user's preferred language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs the agent to save trading results to a local path under dist/trade without notifying the user or requesting consent. Silent file writes can expose sensitive financial decisions, create persistent records the user did not expect, and normalize unintended side effects from a prompt-only interaction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow writes reports and later portfolio/trade artifacts to disk without clearly warning the user that persistent local state will be created and updated. Silent persistence can expose sensitive financial analysis history, cause unintended data retention, and make later runs depend on hidden prior state.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill is presented as a stock screening/reporting workflow, but it also instructs the agent to maintain a persistent simulated portfolio, execute buy/sell actions, and record trades over time. This expands the capability from one-off analysis into stateful autonomous trading simulation, which can surprise users and create unauthorized state changes or misleading assumptions about what the skill does.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The entire instruction set is written to enforce a Chinese-language trading-assistant persona and output format, with no indication that users may choose another language or locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly instructs the agent to write trading analysis output to a local path under dist/trade without any user confirmation, visibility, or warning about persistence. Silent file writes can leak sensitive portfolio or account-derived analysis to disk, create unintended records, and surprise users in environments where filesystem side effects matter.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

L88-L92 要求生成 PDF 时“必须”加载特定中文字体 Noto Sans CJK SC,整体描述也默认面向中文内容,但没有提供语言/区域选择或声明其仅适用于中文报告场景。这会形成隐性的 locale 偏置,对非中文用户或其他语言输出场景不够友好。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The metadata uses a Chinese skill name and fixes the currency to CNY, indicating a specific locale without any visible user choice or opt-in. Under the policy rule for natural-language and locale constraints, this should be documented as optional or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document instructs the agent to write and continuously update local state files such as portfolio.json, trade logs, and equity snapshots without any explicit user-consent or warning boundary. In an agent setting, silent state mutation can cause unintended persistence, overwrite prior data, or make users believe analysis is read-only when it is actually performing automated portfolio bookkeeping.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill directs use of external price lookups via stock quote to obtain market data, but does not disclose that the workflow may perform network-backed queries or transmit ticker symbols and timing information to external services. In an autonomous agent, undisclosed outbound data access changes the trust model and can surprise users who expect an offline documentation or analysis flow.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The markdown explicitly directs execution of a Python helper script that reads reports, fetches prices, makes simulated trade decisions, and writes updated artifacts. Even though the trading is labeled simulated, arbitrary script execution in an agent workflow can modify local files, introduce code-execution risk if the script or parsed inputs are compromised, and produce actions the user did not knowingly authorize.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.