Back to skill

Security audit

Stock Valuation

Security checks for vulnerabilities and agentic risk

Overview

The skill is a plausible stock-report generator, but its report-building code has review-worthy flaws that could expose local files or unsafe web-sourced content in generated reports.

Review before installing. Use this only in a constrained environment with no sensitive local files or credentials available to the agent, avoid untrusted input JSON, and treat generated reports as informational rather than financial advice. Safer installation would require pinned dependencies, private per-run temp directories, path validation for chart files, HTML escaping or templating with autoescape, and JavaScript disabled during PDF rendering.

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/generate_report.py:53
Finding

Unrestricted Chart Paths Allow Arbitrary Local File Disclosure Through Base64 Embedding

Content
View full analysis
') ``` ### Technical Analysis Embedding generated charts as Base64 is consistent with the declared requirement to produce portable HTML reports. The encoding itself is therefore not evidence of a covert channel. However, `b64img()` accepts any regular file path supplied through the data JSON. It does not verify that the file: - Is located in the expected chart-output directory. - Has a permitted filename. - Is a genuine PNG image. - Was created by the current pipeline execution. - Is not a symbolic link. - Falls below a safe size limit. The `data:image/png` prefix does not validate or transform the underlying content. Any readable file is loaded in full, Base64-encoded, and written into the HTML source. This exceeds the minimum filesystem access required to embed the four charts. Because `generate_report.py` accepts an arbitrary JSON file as a positional argument, an attacker who can influence that file can make the process read files available under the agent's operating-system privileges. ### Attack Path 1. The attacker supplies or modifies a pipeline JSON document. 2. A chart entry is changed to reference a sensitive local file: ```json { ...[truncated 1441 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate_report.py:534
Finding

Unescaped Research Data Enables Stored HTML and JavaScript Injection in Generated Reports

Content
View full analysis
"{a.get("title","")}" · {a.get("date","")} · {rating}

{a.get("summary","")}

\n' ``` The same unsafe interpolation pattern appears in other report sections, including: ```python tw_cards += f'
@{t.get("user","")} · {stance}

{t.get("summary","")}

\n' ``` ```python items = "\n".join(f"
  • {c}
  • " for c in cats) ``` ```python items = "\n".join(f"
  • {r}
  • " for r in risks) ``` ### Technical Analysis Research JSON fields are inserted directly into an HTML document without contextual output encoding or sanitization. The affected values include article titles, ratings, summaries, social-media usernames and posts, catalysts, risks, company names, and other pipeline fields. These inputs are not inherently trusted. The Skill instructions require the agent to collect them from web searches, Seeking Alpha, X/Twitter, and fetched earnings pages. Content originating on external websites can contain attacker-controlled markup or text deliberately designed to survive extraction. An injected closing tag can break out of the intended element and introduce arbitrary HTML or JavaScript. Because the report is subsequently opened in a browser or headless Chrome for PDF generation, active content may execute in the browser context. Example maliciou ...[truncated 1996 chars]
    Remediation
    View remediation
    ``` - Disable JavaScript during headless PDF generation where operationally possible. - Validate field types and impose length limits to reduce malformed-document and denial-of-service risks. - Add regression tests using payloads containing `

    T09 · Insecure Skill Coding Practices

    Warning
    Location
    scripts/generate_charts.py:59
    Finding

    Predictable Shared Temporary Files Permit Symlink and Race-Condition Attacks

    Content
    View full analysis
    Remediation
    View remediation

    T08 · Insecure Dependencies

    Warning
    Location
    SKILL.md:19
    Finding

    Runtime Dependencies Are Installed Without Version Pinning or Integrity Locking

    Content
    View full analysis
    Remediation
    View remediation
    Vulnerability Patterns
    • 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
    • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
    Findings (18)

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    95% confidence
    Finding

    The declared description presents a broad valuation-report pipeline with quantitative collection, qualitative web research, and final polished HTML/PDF output. The actual code chunk only accepts a ticker, fetches company metadata from yfinance, selects peers from predefined mappings or industry matching, enriches those peers with basic market data, and prints JSON. While peer detection could be a supporting substep in a valuation workflow, the description does not mention this utility, and the code does not implement the core promised behaviors of report generation, web research, or valuation analysis. Therefore this chunk's primary purpose is materially narrower and different from the declared skill behavior.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    98% confidence
    Finding

    There is a clear description-behavior mismatch. The declared purpose describes an end-to-end valuation reporting pipeline with data collection, external research, and polished report generation. The actual code only fetches earnings calendar information for a ticker using yfinance and returns structured JSON. Its primary purpose is an earnings-date lookup helper, not a valuation-report generator. This is materially different in scope, outputs, and capabilities.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    96% confidence
    Finding

    There is a clear description-behavior mismatch. The declared purpose describes an end-to-end valuation/reporting skill with data collection, external research, and polished report generation. The actual code chunk is limited to ownership-related data retrieval from yfinance for a ticker and prints structured JSON. While insider/institutional ownership data could be one small supporting input to a company analysis workflow, this code by itself does not match the declared primary purpose, output format, or breadth of functionality.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    98% confidence
    Finding

    The declared description centers on a multi-step equity research and valuation-report pipeline, including quantitative data collection, web research, and polished HTML/PDF report creation. The supplied code does none of that. Its primary purpose is narrow and different: retrieving options-market data for the nearest expiry and summarizing options sentiment/activity metrics. That is materially closer to derivatives screening or trading-flow analysis than comprehensive company valuation reporting. While options data could theoretically be a small supporting input in a broader research pipeline, this code chunk exposes a distinct undeclared capability and does not implement the described report-generation behavior.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    97% confidence
    Finding

    There is a clear description-behavior mismatch. The declared purpose emphasizes fundamental/company valuation reporting, qualitative research, analyst views, catalysts/risks, and polished report generation. The actual code only retrieves historical price data and calculates technical indicators commonly used for chart/trading analysis. That is not a supporting implementation detail of the declared report-generation pipeline as presented; it is a distinct analytical capability, especially since the description explicitly says the skill is not for quick price checks or real-time trading signals. While technicals could theoretically be one small component of broader analysis, this code chunk by itself does not implement the described valuation-report workflow and instead provides a materially different primary function.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    99% confidence
    Finding

    This is a clear mismatch. The description claims a multi-step stock valuation and company analysis workflow, including quantitative data collection, web research, and polished report generation. The actual code does none of that. It only processes tweet-like JSON objects from stdin, applies engagement-based filtering thresholds, sorts by engagement, and emits JSON. While social-media research could theoretically be a tiny supporting component of a broader analysis system, this code chunk is narrowly focused on tweet filtering and does not itself implement or directly support the declared primary purpose in a recognizable way. Its primary purpose is materially different from the declared description.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    90% confidence
    Finding

    The code chunk’s behavior is much narrower than the declared description. It only creates chart images from yfinance data and returns their paths in JSON. While charts could be a supporting component of a valuation report workflow, this chunk does not itself produce polished HTML/PDF reports, perform broader data collection in parallel, or do qualitative web research. Because the declared purpose presents a comprehensive reporting pipeline and this code only implements a limited chart-generation utility, the description does not accurately represent what this specific code chunk actually does.

    Content

    No source excerpt is available for this finding.

    Undeclared Tool Scope

    Medium
    Category
    MCP Least Privilege
    Confidence
    92% confidence
    Finding

    The skill instructs the agent to use shell, file reads, and file writes, but the manifest does not declare any explicit tool scope or allowed-tools boundary. That weakens least-privilege controls and makes it easier for the skill to invoke more capability than a reviewer or runtime policy expects.

    Content

    No source excerpt is available for this finding.

    Vague Triggers

    Medium
    Category
    Not specified by scanner
    Confidence
    95% confidence
    Finding

    The invocation text uses broad finance triggers like stock valuation, company analysis, investment thesis, and deep-dive on a ticker, which can cause the skill to activate for a wide range of normal user requests. Over-broad routing increases the chance of unnecessary shell execution, web access, and local file writes in contexts where the user did not explicitly request such actions.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Medium
    Category
    Not specified by scanner
    Confidence
    93% confidence
    Finding

    The skill directs the agent to write multiple artifacts to /tmp, including research JSON, HTML, and PDF, without warning the user that local files will be created. This can expose sensitive prompts, research content, or generated reports to other local processes/users depending on system configuration, and it reduces transparency about persistence side effects.

    Content

    No source excerpt is available for this finding.

    Context-Inappropriate Capability

    Medium
    Category
    Not specified by scanner
    Confidence
    88% confidence
    Finding

    The manifest describes generating comprehensive valuation reports, but this file goes further by algorithmically assigning verdicts such as 'Strong Buy', 'Buy', 'Hold', and 'Sell' and later presenting a 12-month base case target and upside framing. That recommendation engine is a stronger advisory capability than simply assembling a valuation report and is not explicitly declared in the manifest.

    Content

    No source excerpt is available for this finding.

    Context-Inappropriate Capability

    Medium
    Category
    Not specified by scanner
    Confidence
    90% confidence
    Finding

    The manifest frames this skill as producing deep-dive valuation reports and explicitly says it is not for quick price checks, daily watchlist alerts, or real-time trading signals. This code adds a dedicated Technical Analysis section with RSI, SMA, MACD, overbought/oversold labels, and a synthesized 'Technical Signal' callout, which is a trading-signal style capability not justified by the stated non-trading purpose.

    Content

    No source excerpt is available for this finding.

    subprocess module call

    Medium
    Category
    Dangerous Code Execution
    Confidence
    70% confidence
    Finding

    subprocess module calls execute external commands. Without careful input validation, this enables command injection.

    Content

    Scanner excerpt · scripts/run_pipeline.py (reported line 21)May include surrounding context.

    python
    """Run a script and return parsed JSON or error dict."""
        cmd = [sys.executable, os.path.join(SCRIPT_DIR, name)] + args
        try:
            result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
            if result.returncode != 0:
                return {"error": result.stderr.strip() or f"{name} exited with code {result.returncode}"}
            return json.loads(result.stdout)
    

    Missing User Warnings

    Low
    Category
    Not specified by scanner
    Confidence
    79% confidence
    Finding

    This Python file makes external data fetches through yfinance when constructing a Ticker object and accessing t.info, which can transmit the requested tickers and system network metadata to a third-party service. The script has no confirmation prompt or user-facing notice in runtime output describing that a network call will be made.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Low
    Category
    Not specified by scanner
    Confidence
    82% confidence
    Finding

    This Python file makes external data requests via yfinance when constructing a Ticker object and accessing remote-backed properties such as insider transactions. While the module docstring says it fetches data, there is no explicit runtime notice, comment, or warning that using the script will contact an external service and transmit the requested ticker symbol.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Low
    Category
    Not specified by scanner
    Confidence
    82% confidence
    Finding

    This Python file makes external network requests through yfinance when creating the ticker object and fetching options/option-chain data. While the module docstring says it fetches options data, there is no explicit user-facing notice in code output, confirmation, or warning that the script will contact a third-party service and transmit the requested ticker.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Low
    Category
    Not specified by scanner
    Confidence
    91% confidence
    Finding

    The report template sets <html lang="en">, which forces an English locale marker regardless of user preference or input context. Under the policy, locale or language constraints should be optional or clearly justified rather than imposed silently.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Low
    Category
    Not specified by scanner
    Confidence
    84% confidence
    Finding

    This code writes a generated HTML report to a filesystem path derived from input data or a user-supplied --output argument, but the only disclosure is a post-write success message. There is no pre-write warning, confirmation, or explanatory comment/docstring near the write operation indicating that a file will be created or overwritten.

    Content

    No source excerpt is available for this finding.