Back to skill

Security audit

StockMaster Hunter IB Report Generator

Security checks for vulnerabilities and agentic risk

Overview

This stock-report skill is mostly coherent, but it can publish reports containing personal holding details to public URLs and runs PDF conversion with Chrome sandboxing disabled.

Install only if you are comfortable with a finance-report workflow that may include personal holding details in generated files. Before use, require local-only delivery or explicit approval before any upload, redact position data from shareable outputs, and avoid running the PDF converter on untrusted HTML unless Chrome sandboxing is enabled or the conversion is isolated.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/html_to_pdf.sh:131
Finding

Chrome Is Executed Without Its Process Sandbox

Content
View full analysis

Vulnerability Details

File Location: scripts/html_to_pdf.sh, lines 131-144
Vulnerability Type: Browser sandbox disabled during processing of HTML content
Risk Level: High

Code Snippet:

bash
CHROME_ARGS=(
    --headless
    --disable-gpu
    --no-sandbox
    --disable-dev-shm-usage
    --print-to-pdf="$OUTPUT_PDF"
    --no-pdf-header-footer
    --print-to-pdf-no-header
    --virtual-time-budget="$VIRTUAL_TIME_BUDGET"
    --run-all-compositor-stages-before-draw
)

Technical Analysis

The --no-sandbox option disables Chrome's renderer and process sandbox. The sandbox is a critical security boundary intended to contain vulnerabilities triggered while parsing HTML, JavaScript, fonts, images, and other embedded resources.

The script accepts an arbitrary HTML path from its command line and opens that document in Chrome. If the HTML document or one of its referenced resources is malicious, successful exploitation of a Chrome rendering vulnerability would occur without the normal sandbox containment layer. The resulting code could run with the permissions of the user executing this script.

This issue does not itself provide a browser exploit. Exploitation requires a separate vulnerability in the installed Chrome version or another unsafe browser feature. Nevertheless, disabling the sandbox materially increases the impact of such a vulnerability and violates least-privilege execution.

Attack Path

  1. An attacker supplies or influences the HTML report passed to html_to_pdf.sh, or causes the report to reference attacker-controlled content.
  2. The victim invokes the conversion script under their normal account.
  3. Headless Chrome parses the malicious HTML and its embedded resources with --no-sandbox.
  4. The content exploits a compatible Chrome rendering, JavaScript-engine, image-decoder, font-parser, or related vulnerability.
  5. Because the sandbox is disabled, the exploit can ...[truncated 674 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove --no-sandbox and run Chrome with its normal process sandbox enabled.
  • Run conversion under a dedicated, unprivileged service account with no access to secrets or unrelated files.
  • Isolate conversion in a hardened container or virtual machine with a read-only filesystem, a dedicated writable output directory, dropped Linux capabilities, resource limits, and no host-directory mounts beyond required inputs and outputs.
  • Disable network access during conversion unless remote resources are strictly required. Prefer packaging approved images, fonts, and styles locally.
  • Treat report HTML and every referenced resource as untrusted input.
  • Keep Chrome automatically patched and pin the supported browser release in reproducible deployment configuration.
  • If a specific environment cannot start Chrome's sandbox, correct its namespace, user, or container configuration instead of globally disabling the sandbox.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:191
Finding

Reports and Charts Containing User Position Data Are Directed to a Public Upload Service

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 191-194
Vulnerability Type: Unconditional publication of potentially sensitive financial information
Risk Level: High

Code Snippet:

markdown
**Delivery method:**
- Use `FileBatchUpload` to upload HTML and chart files and obtain public URLs
- Use `present_files` to deliver both PDF and HTML formats

Technical Analysis

The skill directs the agent to upload generated HTML reports and charts to obtain public URLs. Elsewhere in the documented workflow, reports are required to include user-provided position information such as purchase price, share count, market value, and unrealized profit or loss.

A public URL is not an appropriate default access-control mechanism for financial position data. Even if a URL is difficult to guess, it remains a bearer-style identifier that can be disclosed through conversation logs, browser history, referrer headers, service logs, link previews, indexing, or accidental forwarding. The instruction does not require user consent, redaction, authentication, an expiration period, or verification of the upload service's retention policy.

Attack Path

  1. A user provides a purchase price and number of shares for portfolio analysis.
  2. The skill includes those values in the HTML report and generated position chart as required by its workflow.
  3. The agent follows the delivery instruction and uploads the HTML and charts through FileBatchUpload.
  4. The service returns public URLs for the uploaded artifacts.
  5. A third party obtains a URL through logs, forwarded output, link previews, referrer leakage, indexing, or another disclosure channel.
  6. The third party retrieves the report and learns the user's investment position and associated financial analysis.

Impact Assessment

The exposed scope can include stock holdings, purchase prices, share quantities, position market value, unrealized gains or losses, an ...[truncated 272 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not upload reports publicly by default. Deliver them through private file attachments or authenticated, access-controlled storage.
  • Obtain explicit, informed user consent before uploading any report to an external service.
  • Clearly identify which files will be uploaded, what information they contain, who can access them, and how long they will be retained.
  • Redact position information and other personal data before external upload unless the user explicitly requests its inclusion.
  • Use short-lived signed URLs with strict expiration, authorization checks, download limits where available, and server-side deletion after delivery.
  • Exclude sensitive values from chart metadata, filenames, HTML source, and logs.
  • Add a mandatory pre-upload privacy review that blocks publication when the report contains holdings, contact details, account data, or other sensitive information.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/html_to_pdf.sh:153
Finding

Chrome Conversion Failures Are Suppressed and Preexisting Output Is Accepted as Successful

Content
View full analysis

Vulnerability Details

File Location: scripts/html_to_pdf.sh, lines 153-157
Vulnerability Type: Suppressed process failure and unsafe output validation
Risk Level: Medium

Code Snippet:

bash
# Execute Chrome
"$CHROME_PATH" "${CHROME_ARGS[@]}" 2>&1 | grep -v "Trying to load the allocator" || true

# Check if output was created
if [ -f "$OUTPUT_PDF" ]; then

Technical Analysis

The pipeline is followed by || true, which converts any Chrome or pipeline failure into a successful shell status. The subsequent validation only checks whether a file already exists at the output path; it does not establish that Chrome created or replaced that file during the current invocation.

Consequently, if the requested output path contains a stale or attacker-controlled file before conversion, and Chrome fails, the script reports the preexisting file as a successfully generated report. This creates an artifact-integrity weakness. It is particularly relevant when output directories are shared, writable by another user, or reused across jobs.

The script also does not verify that the output is a regular, newly generated PDF with an expected header, modification time, ownership, or page structure.

Attack Path

  1. An attacker with write access to the selected output directory places a crafted or misleading file at the expected PDF path.
  2. The attacker or an environmental condition causes Chrome conversion to fail, such as malformed input, browser termination, exhausted resources, or an invalid rendering dependency.
  3. || true suppresses the failed conversion status.
  4. The [ -f "$OUTPUT_PDF" ] test succeeds because the attacker's preexisting file remains present.
  5. The script announces successful PDF generation.
  6. Downstream delivery logic may distribute the attacker-controlled or stale artifact as the newly generated report.

Impact Assessment

This issue permits report substitution o ...[truncated 383 chars]

Remediation
View remediation

Remediation Suggestions

  • Enable reliable pipeline error propagation with set -euo pipefail.
  • Do not append || true to the Chrome execution pipeline. Capture Chrome's exit status and terminate on failure.
  • Remove any existing destination safely before conversion, or write to a newly created temporary file in a private directory and atomically rename it after validation.
  • Create temporary files with mktemp and restrictive permissions, and reject symbolic links or destinations outside an approved output directory.
  • Verify that the output was created during the current invocation and is owned by the expected user.
  • Validate the PDF signature, nonzero size, page count, and parseability before declaring success.
  • Filter known benign log messages without masking the browser's exit code. For example, redirect output to a log file, retain Chrome's status, and filter only when presenting the log.

T08 · Insecure Dependencies

Note
Location
scripts/generate_charts.py:8
Finding

Python Dependencies Are Unpinned and Lack Integrity Verification

Content
View full analysis

Vulnerability Details

File Location: scripts/generate_charts.py, lines 8-12
Vulnerability Type: Unpinned third-party dependency installation guidance
Risk Level: Low

Code Snippet:

python
Usage:
    python generate_charts.py --data data.json --output ./charts/

Requirements:
    pip install matplotlib numpy pandas

Technical Analysis

The installation guidance requests packages by name without exact versions or cryptographic hashes. Installation behavior therefore depends on whichever releases the configured package index resolves at installation time. Builds are not reproducible, and a compromised upstream release, package-index account, mirror, or resolver configuration could introduce malicious code.

The listed names correspond to established packages and there is no evidence that the project intentionally references typosquatted packages. The risk arises from the absence of version locking and artifact integrity verification, so the severity is lower than a dependency that is demonstrably malicious.

Attack Path

  1. A user follows the documented pip install command.
  2. The Python package resolver contacts the user's configured package index or mirror.
  3. A compromised upstream account, index, mirror, or newly published malicious release supplies an affected package artifact.
  4. Package installation or subsequent import executes attacker-controlled package code.
  5. That code runs with the permissions of the user performing installation or chart generation.

Impact Assessment

If the dependency supply chain is compromised, attacker code could execute with the installing user's privileges and access files, environment variables, generated reports, and network resources available to that user. The project itself does not install dependencies automatically, and exploitation depends on an external package or repository compromise.

Remediation
View remediation

Remediation Suggestions

  • Define dependencies in a dedicated lock file with reviewed, exact versions.
  • Use hash-verified installation, such as a generated requirements file containing --hash entries and installation with pip install --require-hashes.
  • Install from the official package index over TLS and prevent untrusted extra indexes or dependency-confusion sources.
  • Run dependency scanning and review vulnerability advisories before updating locked versions.
  • Perform installation and chart generation in an isolated virtual environment or restricted container rather than a privileged global Python environment.
  • Document a controlled update process that regenerates locks and hashes after review and testing.
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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a comprehensive investment banking report generator that should create publication-grade bilingual reports in HTML and PDF, synthesizing multiple expert perspectives and supporting deep report-generation workflows. The supplied code chunk only implements chart generation from a JSON input file and saves image files. While the charts are relevant supporting assets for a stock analysis/reporting tool and include bilingual labels plus technical/fundamental elements, the code’s actual primary purpose is much narrower: generating PNG charts. There is no report assembly, no HTML/PDF export, no natural-language research report generation, and no visible expert-perspective synthesis. Therefore the code chunk materially underimplements and differs from the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

There is a clear description-to-behavior mismatch. The description presents a full-featured investment research report generator for A-share companies, including analytical reasoning, multi-expert synthesis, bilingual content creation, and output in both HTML and PDF. The actual code chunk is a standalone conversion script whose sole purpose is rendering a provided HTML file to PDF via Chrome/Chromium. While PDF export is consistent with one small part of the declared output pipeline, the primary purpose and most claimed capabilities are absent from this code. This is therefore a material mismatch rather than a mere supporting implementation detail.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill omits any upfront warning that generated reports and charts will be uploaded to obtain public URLs, denying users informed consent before potentially sensitive content is disclosed. Because the skill is designed to process position details and investment analysis, nondisclosure of public sharing behavior is especially dangerous and can lead to accidental exposure of personal financial information.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

Requiring user-provided holding information to be incorporated into the report increases the chance that sensitive financial details are stored, displayed, or later shared more broadly than the user expects. In isolation this is a privacy risk; combined with later upload instructions, it becomes substantially more dangerous.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The instructions require that all body content be bilingual and specify '英文为主,中文对照', forcing a language/locale preference regardless of user choice. This is a natural-language policy concern because the skill does not present language selection as optional or user-configurable.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The skill directs use of a shell script that invokes Google Chrome in headless mode, introducing command execution and external binary invocation beyond what the description discloses. This broadens the attack surface because file paths and generated content may be passed into a shell-driven workflow, increasing risk of unsafe execution patterns or misuse in environments where shell access is privileged.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs inclusion of user-provided position details in generated reports and then uploading those reports to public URLs, creating a direct natural-language data exfiltration path. In this context, holdings, buy price, and position size are highly sensitive financial data, so combining mandatory inclusion with public upload creates a serious confidentiality vulnerability.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly instructs uploading generated reports and charts to public URLs, which can expose company analysis content and any embedded user-provided data to anyone with the link or broader public access. In this skill's context, reports may contain sensitive holdings, cost basis, and financial preferences, so public publication materially increases confidentiality risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The formatting standards state that all charts must have bilingual Chinese-English titles and axis labels. This imposes a fixed locale/language output requirement in the skill content, and the file does not indicate that users can choose a different language or opt into bilingual formatting.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This section gives concrete buy, sell, take-profit, and stop-loss instructions with specific thresholds and timing, but does not warn users that it is actionable financial advice, may be unsuitable for their circumstances, and can cause material financial loss. In the context of a skill explicitly designed to generate Morgan Stanley-style investment research reports for A-share stocks, the omission materially increases the chance that users will treat the content as authoritative trading guidance and act on it without appropriate caution.

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 description explicitly brands the tool as a Chinese-language chart generator, and the script consistently embeds bilingual/Chinese labels throughout its output. There is no indication that users can opt in to Chinese localization or select an alternative locale, which can violate language-choice policy for general-purpose skills.

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/html_to_pdf.sh (reported line 117)May include surrounding context.

sh
echo -e "${RED}Error: Google Chrome or Chromium not found.${NC}"
    echo "Please install Google Chrome or Chromium."
    echo "macOS: brew install --cask google-chrome"
    echo "Linux: sudo apt install chromium-browser"
    exit 1
fi

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script launches Chrome/Chromium in headless mode with --no-sandbox while rendering a user-supplied HTML file. Because HTML reports can contain active content and trigger browser parsing of complex resources, disabling the browser sandbox removes an important containment boundary and can turn a browser compromise or unsafe renderer behavior into host-level code execution or data exposure. In this skill context, the converter is likely used on dynamically generated or user-influenced report content, which makes the risk more significant rather than theoretical.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This file is a natural-language reference document and most instructional content is written in Chinese, even though headings are bilingual. Under the language/locale policy rule, forcing a specific language without offering a user choice can be a policy concern when no justification or opt-in is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The comment describes the tool as a "摩根士丹利风格投行报告" converter, embedding a specific Chinese-language branding/style assumption in the natural-language description. There is no indication that users can opt into or change this locale/stylistic framing, which may conflict with language/locale choice expectations.

Content

No source excerpt is available for this finding.