Back to skill

Security audit

Warren Buffet's Brain

Security checks for vulnerabilities and agentic risk

Overview

The core investment-analysis skill is coherent, but the bundled helper tooling has under-scoped local file reading, persistent framework mutation, and a preview server that may expose generated files beyond localhost.

Install only if you are comfortable with a finance research skill that can guide agents to fetch filings, write cached analysis artifacts, and use bundled helper commands. Avoid running oracle.py learn on sensitive files, treat evolve as maintainer-only, and do not run serve-site on an untrusted network unless the bind behavior is fixed or firewalled. Treat BUY/PASS outputs as research framing, not personal financial advice.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
oracle.py:1685
Finding

Local Preview Server Binds to All Network Interfaces

Content
View full analysis

Vulnerability Details

File Location: oracle.py, lines 1685–1689
Vulnerability Type: Unintended network exposure caused by an unrestricted bind address
Risk Level: Medium

Vulnerable Code

python
class ThreadingTCPServer(socketserver.ThreadingTCPServer):
    allow_reuse_address = True

with ThreadingTCPServer(("", args.port), handler) as httpd:
    print(f"Serving Buffett Oracle site at http://127.0.0.1:{args.port}")

Technical Analysis

The empty host string passed to ThreadingTCPServer instructs the operating system to listen on all available network interfaces rather than only on the loopback interface. However, the console message identifies the service as http://127.0.0.1, and the command is documented as a local preview feature.

This discrepancy can lead users to believe the generated site is accessible only from the local machine when it may also be reachable from adjacent network hosts. The server uses SimpleHTTPRequestHandler with its directory restricted to the generated output directory, so the issue does not directly expose arbitrary files outside that directory.

Exploitation requires the preview command to build the site successfully and the selected port to be reachable through host and network firewall controls. The audited artifact does not include the referenced site/ source directory, so the command currently fails before binding unless that directory is restored or otherwise supplied.

Attack Path

  1. A user restores or supplies the expected site/ source directory.
  2. The user runs python3 oracle.py serve-site, optionally selecting a port.
  3. The application builds the static site and binds the HTTP server to all network interfaces.
  4. A network-adjacent attacker identifies the listening port.
  5. The attacker connects to the host and reads generated static files, including research data exposed through files such as assets/site-data.json.

Impact Assessment

An attacker who can reach the ...[truncated 502 chars]

Remediation
View remediation

Remediation Suggestions

Bind the preview server explicitly to the IPv4 loopback interface:

python
with ThreadingTCPServer(("127.0.0.1", args.port), handler) as httpd:

For environments requiring IPv6 loopback, provide a corresponding implementation using ::1.

If remote preview access is a legitimate feature:

  1. Add an explicit --host option that defaults to 127.0.0.1.
  2. Require users to deliberately select a non-loopback address.
  3. Display a prominent warning when binding to 0.0.0.0, ::, or another externally reachable interface.
  4. Clearly print the effective bind address rather than always displaying 127.0.0.1.
  5. Recommend firewall restrictions and avoid serving confidential research through an unauthenticated preview server.
  6. Add an automated test verifying that the default configuration binds only to loopback.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (26)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose is investment analysis, but the detected behavior includes packaging artifacts, modifying project files, browsing paths outside the repository, and running a local HTTP server. That mismatch is dangerous because users may invoke a seemingly analytical skill without realizing it can change local state, access unrelated files, or expose content over a network service.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 11)May include surrounding context.

md
- "SKILL.md"

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · company_cards/AAPL_2015.json (reported line 12)May include surrounding context.

json
"data_source": "FY2015 10-K, SEC EDGAR",
  "analyzed_date": "2026-03-10",

  "hard_gates": {
    "g1_roe_roic": { "value": 0.46, "metric_used": "ROE", "years_averaged": "2013-2015", "pass": true },
    "g2_fcf_to_ni": { "value": 1.31, "fcf": 69800, "net_income": 53400, "pass": true },
    "g3_leverage": { "metric_used": "Net Debt/EBITDA", "value": -1.5, "pass": true },
    "g4_revenue_trend": { "description": "Strong growth driven by iPhone ecosystem", "structural_decline": false, "pass": true },
    "g5_gross_margin_trend": { "description": "~40% gross margin, stable to expanding", "declining_2plus_years": false, "pass": true },
    "g6_earnings_yield": { "value": 0.12, "net_income_m": 53400, "ev_m": 445000, "exemption": null, "pass": true },
    "g7_moat": { "verdict": "PASS", "moat_type": "switching_cost", "description": "iPhone ecosystem: App Store, iMessage, AirDrop, iCloud, Apple Watch integration create switching costs estimated at $1,000+ per customer. 1B+ active devices. Ser

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The evolve command directly appends operator-provided content to the core buffett_brain.md knowledge file, permanently mutating the skill's behavior and outputs. In a skill context this is high risk because prompt/knowledge poisoning can be introduced interactively without validation, review, or integrity controls, affecting all future analyses and potentially embedding malicious instructions into the distributed artifact.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs the agent to fetch new data from SEC EDGAR and create persistent company-card artifacts when a cache miss occurs. That expands behavior beyond a cached, point-in-time analysis skill into network access and repository mutation, which can violate least-privilege expectations, introduce unreviewed external content into the workflow, and create opportunities for prompt/data poisoning through fetched documents.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The instructions require appending to backtest history and updating an index as part of routine analysis output. This turns an analytical skill into one that mutates benchmark records, which can silently alter project state, poison future analyses that rely on those files, and create integrity issues if conclusions are written automatically without human review.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill declares no explicit tool scope even though it appears to rely on file reads, file writes, shell access, and environment access. Missing least-privilege boundaries can let a research-oriented skill perform broader local actions than users would reasonably expect, increasing the chance of unintended file modification or data exposure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill enables implicit invocation with no trigger constraints, exclusions, or narrowing conditions, which can cause the agent to invoke this finance-analysis capability in broader contexts than intended. Because the skill produces authoritative BUY/PASS style investment analysis, unintended invocation could influence financial decisions, create inappropriate tool routing, or surface domain-specific outputs when the user did not explicitly request them.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The title and surrounding prose present the skill artifact in Chinese/mixed Chinese throughout, with no indication that language selection is optional or user-configurable. For a generally applicable benchmark/results document, this creates a locale policy concern because it effectively mandates a specific language without opt-in or documented regional scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document's instructional content is written entirely in Chinese, including core operating guidance and decision rules, with no indication that users may choose another language or that the skill is intentionally restricted to a Chinese-speaking audience. This creates a natural-language locale constraint that is not presented as an opt-in or justified regional requirement.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest frames the skill as stock-focused Buffett-style company analysis, Berkshire case studies, and benchmarked BUY/PASS memos. The Web3/crypto mapping section adds a separate asset-class analysis framework for protocols and tokens, which goes beyond the described stock/company-analysis scope rather than serving as an obvious implementation detail.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This card claims strict point-in-time analysis for a 2020-style underwriting memo, but it embeds post-decision Berkshire ownership data from 2021 and 2022 in the same artifact. In an investment-analysis skill, that creates hindsight leakage and can bias outputs, benchmarks, or model judgments by contaminating supposedly contemporaneous analysis with future information.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The helper script exposes mutation and packaging features (evolve, site generation, marketplace bundle creation) that materially exceed a narrow stock-analysis skill. In an agent-skill context, extra write/build capabilities enlarge the trusted computing base and create unnecessary opportunities for repository tampering, data exfiltration into generated artifacts, or unintended operational side effects.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill reads corpus locations from an environment variable and supports learn <file> on arbitrary local paths, expanding access beyond the described cached company-card workflow. In an agent setting, this makes the skill capable of traversing and ingesting unrelated local documents, which can leak sensitive workstation or workspace data into prompts, logs, or generated files.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code can start a local HTTP server, which is outside the core investment-analysis purpose and introduces network-facing behavior into a skill that otherwise appears file-centric. Even though it binds locally by default, agent environments and port-forwarded/devcontainer setups can expose such services unexpectedly, increasing attack surface and enabling accidental disclosure of generated repository data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language prompt generated by cmd_learn is entirely in Chinese and instructs the downstream assistant in that language, without offering the user a language choice. This can violate language/locale policy expectations for skills that should not force a specific language unless clearly opt-in or region-justified.

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 · oracle.py (reported line 1947)May include surrounding context.

python
try:
        import subprocess

        subprocess.run("pbcopy", input=prompt.encode(), check=True)
        print("\n✅ 已自动复制到剪贴板,直接 Cmd+V 粘贴即可。")
    except Exception:
        pass

Tainted flow: 'prompt' from pathlib.Path.read_text (line 1915, file read) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · oracle.py (reported line 1947)May include surrounding context.

python
try:
        import subprocess

        subprocess.run("pbcopy", input=prompt.encode(), check=True)
        print("\n✅ 已自动复制到剪贴板,直接 Cmd+V 粘贴即可。")
    except Exception:
        pass

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The cmd_evolve workflow uses Chinese-only user-facing prompts and status messages, requiring users to interact in a specific language. There is no visible option to switch languages or indication that the tool is intentionally Chinese-only.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations. The main summary table headers switch to Chinese at L018 and the detailed sections continue in Chinese throughout, but the file does not indicate that the skill is intentionally Chinese-only or offer any user opt-in for language preference.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This JSON manifest includes target names in both English and Chinese, such as "Airlines(买入)" and "BNSF铁路", but provides no natural-language note that users may choose a locale or that the dataset is intentionally bilingual. Under the policy for natural-language content, forcing or implicitly assuming a language/locale without opt-in or justification can be a policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The file references unrestricted local filesystem paths, which can reveal host-specific directory structure and encourage an agent to rely on undeclared local data sources outside the stated cached-company-card boundary. In an agent setting, this creates a risk of unintended local file access or leakage of environment details if the runtime has filesystem tools attached.

Content

No source excerpt is available for this finding.

Ssd 3

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

Embedding absolute local filesystem paths discloses user-specific environment information such as directory names and personal workspace structure. Even if not directly exploitable alone, such details can aid targeted prompt attacks, social engineering, or follow-on attempts to coerce the agent into reading sensitive local files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The JSON includes descriptive natural-language text stating that 'TBTF status provides implicit government backstop' as part of the moat rationale. This embeds a normative policy-laden assumption in the skill data without any caveat, user opt-in, or documented jurisdiction-specific justification.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This JSON file appears to be a manifest/data file, but it contains no fields describing how or when the skill should activate. For manifest-style files, missing trigger specificity can lead to ambiguous or overly broad invocation behavior elsewhere in the system because no explicit trigger phrases, scope limits, or exclusion conditions are documented here.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.