Back to skill

Security audit

Boheng Investment Workflow

Security checks for vulnerabilities and agentic risk

Overview

This investment-analysis skill is mostly coherent, but it needs review because it automatically reads global user profile data and has inaccurate security disclosures about saved data, HTTP traffic, and browser subprocess use.

Review before installing. Use it only if you are comfortable with automatic reading of USER.md investment preferences and local persistence of derived profile details in reports. Prefer a virtual environment, pin dependencies, disable browser news unless needed, and treat generated recommendations as informational rather than financial advice.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/user_profile.py:41
Finding

Automatic Overbroad Access to Global Agent Memory

Content
View full analysis

Vulnerability Details

File Location: scripts/user_profile.py:41-51, scripts/user_profile.py:59-123, and scripts/analyze_stock.py:192-201
Vulnerability Type: Excessive access to global Agent memory
Risk Level: Medium

Vulnerable Code

python
def __init__(self):
    self.user_md_path = "/root/.openclaw/workspace/USER.md"

def load_profile(self) -> UserProfile:
    """Load the user profile."""
    if not os.path.exists(self.user_md_path):
        print("USER.md does not exist; using the default profile")
        return self.DEFAULT_PROFILE

    try:
        with open(self.user_md_path, 'r', encoding='utf-8') as f:
            content = f.read()

        return self._parse_user_md(content)
    except Exception as e:
        print(f"Failed to read USER.md: {e}; using the default profile")
        return self.DEFAULT_PROFILE

The stock-analysis workflow automatically enables this behavior:

python
personalized_advice = generate_personalized_advice(
    code=code,
    name=name,
    quote=quote,
    financial=financial,
    analyst_results=analyst_results,
    final_vote=final_vote,
    final_score=final_score,
    user_profile=None,  # Automatically loaded from USER.md
    graham_score=None
)

The resulting profile data is subsequently included in report output:

python
lines.append(f"\nUser profile: {user_profile.name}")
lines.append(f"   Investment style: {user_profile.investment_style}")
lines.append(f"   Risk preference: {user_profile.risk_preference}")
lines.append(f"   Holding period: {user_profile.holding_period}")
lines.append(f"   Expected return: {user_profile.expected_return}%")

Technical Analysis

The Skill reads the complete global OpenClaw USER.md file whenever personalized stock advice is generated. It only needs a limited set of investment preferences, but it loads and scans the entire file, including potential ...[truncated 1646 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace access to the global USER.md with a dedicated file such as ~/.openclaw/workspace/investment/profile.json.
  2. Require explicit opt-in before loading personalized information.
  3. Parse a strict schema containing only necessary fields:
    • Investment style
    • Risk preference
    • Holding period
    • Expected return
    • Position and stop-loss limits
  4. Do not scan unrestricted profile text using broad keyword matching.
  5. Resolve the profile path through os.path.expanduser() instead of hardcoding /root.
  6. Avoid writing the user's name or other identifying information into reports unless explicitly requested.
  7. Apply restrictive permissions, such as mode 0600, to reports containing profile information.
  8. Document the exact fields read, how they affect analysis, and where derived information is stored.

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unpinned Third-Party Dependencies Installed Directly with pip

Content
View full analysis

Vulnerability Details

File Location: requirements.txt:1-4 and scripts/install.sh:30-45
Vulnerability Type: Mutable and unverified software supply chain
Risk Level: Medium

Vulnerable Code

text
requests>=2.28.0
beautifulsoup4>=4.11.0
lxml>=4.9.0
duckduckgo-search>=7.0
bash
if [ -f "$SCRIPT_DIR/../requirements.txt" ]; then
    pip3 install -r "$SCRIPT_DIR/../requirements.txt" || {
        echo "Dependency installation failed; check pip or the network connection"
        exit 1
    }
else
    pip3 install requests beautifulsoup4 || {
        echo "Dependency installation failed; check pip or the network connection"
        exit 1
    }
fi

Technical Analysis

All dependencies use lower-bound-only constraints, allowing pip to install any future release. No lockfile, package hashes, trusted index restriction, or mandatory virtual environment is used.

Python packages may run code during installation and are later imported into the Skill process. Therefore, compromise of an allowed package release or its dependency graph can introduce arbitrary code after the Skill itself has already been reviewed.

The fallback branch is even less constrained because it installs package names without any version requirement. The script recommends a virtual environment but does not enforce one, so packages may be installed into a shared interpreter environment.

Attack Path

  1. An attacker compromises a dependency account, package release, or transitive dependency.
  2. A new malicious version is published while still satisfying the broad >= constraint.
  3. A user runs the documented install.sh script.
  4. pip resolves and downloads the mutable malicious release.
  5. Package installation code executes with the permissions of the user running the installer.
  6. The package remains available to the Skill and potentially to other applications using the same Pyth ...[truncated 585 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin every direct dependency to an exact audited version.
  2. Generate a lockfile that also fixes transitive dependency versions.
  3. Use hashes and install with pip --require-hashes.
  4. Require installation inside a dedicated virtual environment.
  5. Configure an approved package index rather than relying on arbitrary pip configuration.
  6. Run dependency vulnerability and provenance checks in continuous integration.
  7. Remove dependencies that are not needed by default.
  8. Separate optional news-search dependencies from the minimal core installation.
  9. Ensure updates are reviewed and tested before changing pinned versions.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/stock_news.py:206
Finding

Stock Search Data Sent over Plaintext HTTP Despite HTTPS-Only Declaration

Content
View full analysis

Vulnerability Details

File Location: scripts/stock_news.py:206-249
Vulnerability Type: Plaintext transmission and unauthenticated financial-news responses
Risk Level: Medium

Vulnerable Code

python
def _get_cninfo_news(self, stock_name: str, limit: int) -> List[Dict]:
    """CNInfo listed-company announcements."""
    try:
        url = "http://www.cninfo.com.cn/new/hisAnnouncement/query"
        data = {
            'pageNum': 1,
            'pageSize': limit * 3,
            'searchkey': stock_name,
            'category': '',
            'isHLtitle': 'true',
        }

        resp = self.session.post(
            url,
            data=data,
            headers=self.headers,
            timeout=15
        )
        if resp.status_code != 200:
            return []

        result = resp.json()
        announcements = result.get('announcements', [])

        news_list = []
        seen_titles = set()

        for ann in announcements:
            secName = ann.get('secName', '')
            title = ann.get('announcementTitle', '')

            if stock_name not in secName:
                continue

            title = re.sub(r'<[^>]+>', '', title)

            if title in seen_titles:
                continue
            seen_titles.add(title)

            date = ann.get('announcementTime', 0)
            date_str = (
                datetime.fromtimestamp(date / 1000).strftime('%Y-%m-%d')
                if date else ''
            )

            news_list.append(self._sanitize_news_item({
                'title': title,
                'date': date_str,
                'url': (
                    "http://www.cninfo.com.cn/new/disclosure/detail"
                    f"?orgId=990000&announcementId={ann.get('announcementId')}"
                ),
            }, 'CNInfo'))

The declared policy in SKILL.md states:

...[truncated 1959 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace all CNInfo URLs with verified HTTPS endpoints.
  2. Reject redirects that downgrade from HTTPS to HTTP.
  3. Change sanitize_url() to accept only URLs with an https scheme.
  4. Validate the destination hostname against a runtime-enforced allowlist.
  5. Add tests that fail whenever an http:// URL appears in executable code.
  6. Do not rely on content sanitization as a substitute for transport authentication.
  7. Where available, validate announcement identifiers and metadata against a second authenticated source.
  8. Align the documented domain allowlist with every actual runtime endpoint.

T09 · Insecure Skill Coding Practices

Note
Location
scripts/stock_news.py:298
Finding

News Module Is Syntactically Invalid and Uses an Undeclared subprocess Interface

Content
View full analysis

Vulnerability Details

File Location: scripts/stock_news.py:298-365 and scripts/stock_news.py:407
Vulnerability Type: Broken security-critical module and inaccurate execution declaration
Risk Level: Low

Vulnerable Code

The optional browser feature invokes an external executable through subprocess, but the module never imports subprocess:

python
def _get_browser_news(self, stock_name: str, limit: int) -> List[Dict]:
    """
    Use the Agent Browser CLI to retrieve financial news.
    """
    import urllib.parse

    news_list = []
    seen_titles = set()

    search_url = (
        "https://so.eastmoney.com/web/s"
        f"?keyword={urllib.parse.quote(stock_name)}"
    )

    session_name = f"news_{int(time.time())}"

    try:
        cmd = [
            'agent-browser',
            '--session',
            session_name,
            'open',
            search_url
        ]
        result = subprocess.run(
            cmd,
            capture_output=True,
            text=True,
            timeout=20
        )
        if result.returncode != 0:
            return []

        time.sleep(3)

        cmd = [
            'agent-browser',
            '--session',
            session_name,
            'snapshot',
            '-i',
            '--json'
        ]
        result = subprocess.run(
            cmd,
            capture_output=True,
            text=True,
            timeout=15
        )
        if result.returncode != 0:
            return []

    except subprocess.TimeoutExpired:
        print("Agent Browser timed out")
    except Exception as e:
        print(f"Agent Browser error: {str(e)[:30]}")
    finally:
        try:
            subprocess.run(
                ['agent-browser', '--session', session_name, 'close'],
                capture_output=True,
                timeout=5
            )
 
...[truncated 2367 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the malformed if __</tool_call>} line.
  2. Explicitly import subprocess if the browser CLI remains necessary.
  3. Update the Skill manifest and documentation to disclose subprocess use accurately.
  4. Prefer a constrained native browser API over spawning a local executable.
  5. Resolve agent-browser to a trusted absolute path and verify the executable identity.
  6. Continue passing arguments as a list and never enable shell=True.
  7. Validate stock-name length and allowed characters before constructing the search URL.
  8. Add automated syntax compilation, module-import, and browser-mode tests.
  9. Replace broad exception suppression with explicit errors and auditable fallback messages.
  10. Ensure fallback behavior clearly indicates when news retrieval or sanitization did not execute.
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (82)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill package includes uninstall behavior with destructive deletion semantics such as removing local application data and using rm -rf. When a skill primarily advertised as investment research also contains destructive maintenance actions, that creates a significant safety risk if those actions are invoked accidentally, socially engineered, or insufficiently constrained.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The module header claims it only uses whitelisted domains and lists only qt.gtimg.cn, but the implementation also reaches AKShare-backed sources, baostock, Tencent K-line endpoints, and Eastmoney. In an agent skill, inaccurate disclosure of network destinations weakens trust boundaries and can cause operators to approve code under false assumptions about data egress.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/uninstall.sh (reported line 12)May include surrounding context.

sh
echo ""

if [[ $REPLY =~ ^[Yy]$ ]]; then
    rm -rf ~/.openclaw/investment
    echo "✅ 已删除数据目录"
else
    echo "ℹ️ 数据目录已保留:~/.openclaw/investment"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/uninstall.sh (reported line 12)May include surrounding context.

sh
echo ""

if [[ $REPLY =~ ^[Yy]$ ]]; then
    rm -rf ~/.openclaw/investment
    echo "✅ 已删除数据目录"
else
    echo "ℹ️ 数据目录已保留:~/.openclaw/investment"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill exposes meaningful capabilities—network access, file reads/writes, environment-variable use, and shell-oriented installation/uninstall examples—without a clear standardized tool-scope declaration such as explicit permissions or allowed-tools. This increases the chance that a host agent grants broader access than users expect, especially because the skill also mentions local persistence and optional browser-driven fetching.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger keywords are broad, common finance phrases such as '分析', '投资', and '股票怎么样', making accidental activation likely. In a network-enabled, file-writing skill that may read USER.md and optionally fetch web/news content, unintended invocation can lead to unnecessary data access, local persistence, or exposure to untrusted external content without clear user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file generates concrete buy/caution/sell outputs and detailed price targets, but the returned analyst reasons do not include a user-facing disclaimer that the content is for informational use only and not financial advice. In an investment workflow, users may act on these recommendations directly, increasing the risk of financial harm, regulatory exposure, and over-reliance on automated outputs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Natural-language strings in the module description, CLI usage, status output, and report content are all hard-coded in Chinese. This forces a locale/language choice on users with no opt-in or documented regional justification, which matches the policy's language-choice concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script’s docstrings, status messages, report contents, and CLI usage are all hard-coded in Chinese, which imposes a specific language on users without any opt-in or configuration. This matches the policy category for language or locale constraints that are not optional or explicitly justified.

Content

No source excerpt is available for this finding.