Back to skill

Security audit

Aastock Daily

Security checks for vulnerabilities and agentic risk

Overview

This A-share reporting skill is broadly on-topic, but it silently uses credentials and contains simulated or stale financial analysis that could mislead users.

Review before installing. Do not use this with a real or sensitive portfolio until the publisher removes the embedded API key, documents credential and network use, replaces simulated/stale report values with sourced current data, and validates API responses. Testing should be done in a sandbox with non-sensitive holdings.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/portfolio.sh:106
Finding

Remote API Data Is Interpolated Directly into Executable Python Source

Content
View full analysis
= 100000000: print(f'{flow/100000000:.2f}亿') elif abs(flow) >= 10000: print(f'{flow/10000:.2f}万') else: print(f'{flow:.0f}') " 2>/dev/null) ``` ### Technical Analysis The `flow` shell variable is derived from the `f62` field returned by the remote authenticated market-data API. It is subsequently inserted into the source text passed to `python3 -c`. Shell quoting does not make this safe because the substitution occurs while Bash constructs the Python program. If the API returns a value containing a single quote followed by Python syntax, the value can terminate the argument to `float()` and introduce arbitrary Python statements. Although the endpoint normally returns numeric market data, the code does not validate that `flow` is numeric before constructing executable source. Exploitation would therefore be possible if the API service, its response-generation pipeline, DNS resolution, trusted infrastructure, or another upstream data source were compromised. ### Attack Path 1. An attacker gains control over, or causes malicious content to be returned by, the quote API used by `get_stock_quote`. 2. The attacker places a Python payload in the returned `f62` field. 3. `get_stock_quote` emits that field as the fifth pipe-delimited value. 4. `portfolio.sh` assigns it to `flow`. 5. The value is substituted into the `python3 -c` source at line 107. 6. The injected Python executes with the same OS account and permissions as the Skill process. ### Impact Assessment Successful exploitation permits arbitrary Python execution and, through modules such as `os` or `subprocess`, arbitrary command execution. The attacker could read files available to the Skill account, modify pro ...[truncated 257 chars]
Remediation
View remediation
= Decimal("100000000"): print(f"{value / Decimal('100000000'):.2f}e8") elif abs(value) >= Decimal("10000"): print(f"{value / Decimal('10000'):.2f}e4") else: print(f"{value:.0f}") ') ``` Apply the same rule to all shell variables: treat configuration and network responses as data, never as fragments of shell or Python source. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/common.sh:49
Finding

Undocumented Credential-Vault Access and Hard-Coded API Credential

Content
View full analysis
/dev/null) KEY_COUNT=$(echo "$KEY_LIST" | python3 -c "import sys; print(len(sys.stdin.read().split('|||')))" 2>/dev/null) fi fi [ -z "$KEY_LIST" ] && KEY_LIST="mkt_qUycJtiyNGUu0z7CtEX5RrAZZuCYVAr1hhx3bsk_HZ4" && KEY_COUNT=1 } ``` ### Technical Analysis The Skill first checks an environment variable, but otherwise silently reads a credential file under the OpenClaw workspace vault. This access is not disclosed in the documented configuration procedure. The declared functionality needs an API credential, but it does not inherently require broad knowledge of, or direct access to, an agent-wide credential directory. The code also embeds a complete API key in the distributed source. Anyone who receives the package can extract and reuse that credential. Shared credentials cannot provide reliable attribution or per-user revocation and may be exhausted, suspended, or abused by unrelated users. The vault path itself is fixed and interpolated into Python source. Although `HOME` is normally trusted process state, passing file paths through Python source rather than an argument is an unnecessary unsafe pattern. ### Attack Path Embedded-key abuse: 1. An attacker downloads or reads the Skill package. 2. The attacker extracts the API key from `scripts/common.sh`. 3. The attacker ...[truncated 1160 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/common.sh:194
Finding

Financial Market Data Is Retrieved over Unencrypted HTTP

Content
View full analysis
/dev/null | \ python3 -c " import json,sys try: data = json.load(sys.stdin) items = data.get('data', {}).get('diff', []) for item in items: name = item.get('f14', '') flow = item.get('f62', 0) or 0 flow_str = f'{flow/100000000:.2f}亿' if abs(flow) >= 100000000 else f'{flow/10000:.2f}万' print(f'{name}|{flow_str}') except: pass " } ``` The same cleartext host is used for limit-up lists and limit statistics. ### Technical Analysis The requests use `http://` rather than HTTPS. HTTP provides neither server authentication nor transport integrity. An attacker able to observe or modify traffic can replace the JSON response without compromising EastMoney itself. The returned values are used to produce market-flow rankings, limit-up lists, and closing statistics. The code performs only structural JSON parsing and does not authenticate responses, verify provenance, or enforce plausible numeric ranges. `curl -s` also suppresses diagnostics, and the commands do not use `--fail`, making network errors difficult to distinguish from valid empty data. ### Attack Path 1. A user runs a report on an untrusted or attacker-observable network. 2. The Skill sends an HTTP request to `push2.eastmoney.com`. 3. A network attacker intercepts the request or spoofs the response. 4. The attacker supplies syntactically valid JSON containing altered stock names, prices, flows, or totals. 5. ...[truncated 573 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
parsers/parse_v15.py:360
Finding

Fixed Shared Temporary Paths Permit Symlink-Based File Overwrite

Content
View full analysis
Remediation
View remediation

other

Error
Location
scripts/deep-portfolio.sh:80
Finding

Simulated and Hard-Coded Values Are Presented as Financial Analysis

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/close.sh:86
Finding

Function Shadowing Causes Unbounded Recursion in the Closing Report

Content
View full analysis
/dev/null) IFS='|' read -r limit_up limit_down <<< "$stats" ``` The shared library already defines a function with the same name: ```bash get_limit_stats() { local up=$(curl -s "http://push2.eastmoney.com/api/qt/clist/get?pn=1&pz=1&po=1&np=1&ut=fa5fd1943c7b386f172d6893dbfba10b&fltt=2&invt=2&fid=f3&fs=m:0+t:6,m:0+t:13,m:1+t:2,m:1+t:23&fields=f12&cb=jQuery" 2>/dev/null | grep -o '"total":[0-9]*' | head -1 | cut -d: -f2) local down=$(curl -s "http://push2.eastmoney.com/api/qt/clist/get?pn=1&pz=1&po=0&np=1&ut=fa5fd1943c7b386f172d6893dbfba10b&fltt=2&invt=2&fid=f3&fs=m:0+t:6,m:0+t:13,m:1+t:2,m:1+t:23&fields=f12&cb=jQuery" 2>/dev/null | grep -o '"total":[0-9]*' | head -1 | cut -d: -f2) echo "${up:-0}|${down:-0}" } ``` ### Technical Analysis `close.sh` sources `common.sh` and then defines another function named `get_limit_stats`. The later definition replaces the shared function in the current shell. Inside the replacement function, `get_limit_stats` resolves to the replacement itself, not to the original library implementation. Command substitution repeatedly invokes the same function, producing unbounded recursion until shell or operating-system resource limits terminate execution. This is a deterministic availability flaw. It does not require attacker-controlled input, but an attacker who can repeatedly trigger report generation could amplify CPU and process consumption. ### Attack Path 1. The user or scheduler runs `scripts/close.sh`. 2. The script sources the shared `get_limit_stats` function. 3. The local definition in `close.sh` shadows the shared function. 4. The report calls `get_limit_stats`. 5. The function invokes itself th ...[truncated 585 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (45)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description suggests an end-user skill for automated market briefings and portfolio management features. However, the supplied code only performs text parsing of a local snapshot file, filtering headings/paragraphs/lists/tables, writing a parse result, loading a ground-truth file, and printing comparison statistics. There is no evidence of fetching A-share news, monitoring holdings, analyzing sentiment, pushing reports at market times, or handling weekend updates. This is a material purpose mismatch rather than a mere implementation detail.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The code generally aligns with a stock-reporting/portfolio-assistant backend because it provides market data, news query, and portfolio/config helpers relevant to A-share briefings. However, there is a meaningful description-behavior mismatch in two ways. First, the code accesses credentials from an external local vault path (${HOME}/.openclaw/workspace/vault/credentials/eastmoney.json) and also embeds a fallback API key, while the declared permissions are empty; this is an undeclared sensitive capability/resource access. Second, several key advertised features—automatic push notifications, position monitoring logic, stock-forum sentiment monitoring, and weekend report workflows—are not evidenced in this code chunk. Absence alone would not always be a mismatch for a partial file, but here the chunk's concrete behavior is more narrowly a shared market-data/API utility library than the full declared assistant behavior. Therefore this should be flagged as a mismatch, primarily due to undeclared credential/resource access and partially because the implemented behavior is narrower than the declared feature set.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description promises a broader A-share daily reporting and portfolio monitoring skill with automated multiple daily briefings, portfolio stock monitoring, stock-forum sentiment tracking, and weekend support. The supplied code chunk only implements a weekly Sunday deep report. It reads the portfolio and fetches some news, but the '持仓股一周动态' section ignores the parsed portfolio and instead searches/news-summarizes a hard-coded list of stocks. It also generates fake weekly changes using a fixed random seed, which materially differs from genuine holding monitoring. There is no evidence here of stock-forum/股吧 sentiment collection, nor of pre-market, close, or nighttime report generation. Because the actual behavior is narrower and materially different from the declared purpose, this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description presents a broader skill: a daily A-share briefing plus portfolio manager with automated pre-market/closing/night pushes, holding-stock monitoring, stock-forum sentiment tracking, and weekend news support. The supplied code only covers generation of a single pre-market briefing (morning.sh). It fetches/indexes market data, external market summaries, commodities, and morning news, and exits early on weekends with a simple closure notice. There is no evidence in this chunk of monitoring user holdings, tracking stock-specific dynamics or 股吧 sentiment, generating closing or night briefings, or performing any automatic push behavior. Thus the implemented behavior is materially narrower than the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The declared description presents a broader 'A股日报 + 持仓管家' capability set: automatic pre-market/post-close/night reports, portfolio monitoring, stock-forum sentiment tracking, and weekend support. The supplied code chunk is much narrower: it is a weekday-only nighttime recap generator. It builds a 夜间复盘 report and explicitly returns early on weekends, which conflicts with '支持周末资讯' for this chunk. It also contains no logic related to user holdings or 股吧舆情 monitoring. While a nighttime briefing is consistent with part of the description, the actual behavior shown omits several central declared capabilities and therefore does not accurately represent the broader declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
86% confidence
Finding

The declared description presents a broad 'A股日报 + 持仓管家' skill focused on automated daily briefing pushes, portfolio event monitoring, forum sentiment, and weekend information. The supplied code chunk instead implements a specific weekly valuation-analysis report for current holdings. It reads a portfolio, fetches quotes and fundamentals from Eastmoney, and formats valuation metrics and heuristics. While this is related to portfolio management, it does not implement several key declared behaviors, especially automatic pre/open/close/night reports, stock forum sentiment monitoring, or weekend news. The code’s primary purpose is narrower and materially different from the declared description, so this is a mismatch.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

A hardcoded fallback API key is embedded directly in the script and used automatically when no user key is present. Hardcoded secrets are routinely leaked through source distribution, logs, backups, or reuse, and the silent fallback hides credential use from operators.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/common.sh (reported line 146)May include surrounding context.

sh
fi
    
    local result
    result=$(curl -s --connect-timeout 10 \
        -X POST "https://mkapi2.dfcfs.com/finskillshub/api/claw/query" \
        -H "Content-Type: application/json" \
        -H "apikey: $(get_current_api_key)" \

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This is a real integrity vulnerability: the function presents a 'deep portfolio report' but ignores the user's actual holdings and instead reports simulated weekly changes for a hard-coded stock list using pseudo-random values. In a financial advisory skill, fabricated performance data can mislead users into making investment decisions based on false information, and the mismatch between claimed analysis and actual behavior materially increases the risk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
73% confidence
Finding

The skill documentation advertises shell-driven scripts, local config files, logs, and file operations but does not declare any explicit tool scope or permissions. That creates an authorization/transparency gap: users and reviewers cannot tell what filesystem or shell access the skill expects, increasing the risk of overbroad execution in an agent environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill explicitly asks users to place portfolio holdings in config.json and states that market/news/sentiment data comes from third-party APIs, but it does not clearly warn users that watchlist or portfolio identifiers may be transmitted externally. In a financial context, holdings data can be sensitive and reveal investment intent, so omission of this disclosure materially increases privacy risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The portfolio entries are hard-coded to Chinese company names and stock codes, indicating the skill is constrained to a specific language/market context. Because this locale-specific behavior is embedded in the configuration without any accompanying opt-in, choice, or justification in the file, it may violate the policy against forcing a specific language or locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script's user-facing strings, headings, and output are entirely in Chinese, and there is no indication that the user can choose another language or that the skill is intentionally restricted to a Chinese-language audience. This creates a natural-language policy concern because the skill effectively forces a specific language without explicit opt-in or justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The surrounding documentation and function naming indicate a limit-up/limit-down statistics section, but L090-L094 query clist endpoints sorted by price-change direction and print those totals as '涨停' and '跌停'. That behavior does not match the stated intent of counting actual limit-up/limit-down stocks, so the labels/documented intent contradict the implementation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

At L076 the inline comment states that net outflow sectors are being handled by a simple negative-pct rule. However, L077-L079 do not inspect pct or any fetched data at all, and instead return fixed sector names and amounts. This is an active contradiction between the code comment and the implemented behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The natural-language title identifies the skill as an A-share daily report in Chinese, with no indication of language choice or user opt-in. This may conflict with language/locale policy when a skill implicitly fixes its language rather than offering a choice or documenting a justified locale constraint.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script accesses credentials from an environment variable and a local user vault, then silently falls back to a hardcoded API key. This creates insecure secret handling, expands the skill's privilege surface, and may cause unauthorized use of user or embedded credentials without consent or visibility.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script reads a sensitive credential from the environment and uses it for external API access without any visible disclosure or user control path. While environment-based secrets are normal operationally, the undisclosed use is risky in a user-facing skill because it can silently consume privileged credentials.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The script performs external POST requests to a remote market API and includes an API key plus arbitrary request data. External transmission is inherent to this skill's function, but it becomes security-relevant because the transmitted content may include sensitive portfolio or query data and there is no explicit trust boundary or user disclosure.

Content

Scanner excerpt · scripts/common.sh (reported line 98)May include surrounding context.

sh
local api_key=$(get_current_api_key)
        [ -z "$api_key" ] && break
        
        local response=$(curl -s -X POST "${API_BASE}${endpoint}" \
            -H "Content-Type: application/json" \
            -H "apikey: ${api_key}" \
            -d "${data}" 2>&1)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The function sends caller-supplied data and an API key to an external endpoint without any visible user disclosure, consent boundary, or data minimization. In a portfolio-monitoring skill, outbound transmission is expected, but undisclosed sending of queries or holdings-related content still creates privacy and compliance risk.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This function directly sends stock query content and the active API key to a third-party endpoint. Although market-data retrieval requires network access, the implementation provides no transparency, endpoint integrity checks beyond HTTPS, or limits on what query content can be transmitted.

Content

Scanner excerpt · scripts/common.sh (reported line 146)May include surrounding context.

sh
fi
    
    local result
    result=$(curl -s --connect-timeout 10 \
        -X POST "https://mkapi2.dfcfs.com/finskillshub/api/claw/query" \
        -H "Content-Type: application/json" \
        -H "apikey: $(get_current_api_key)" \

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The comments and output framing imply portfolio-specific weekly movement analysis, but the implementation only performs a generic news search and then emits simulated changes unrelated to real market data. In the context of an automated portfolio-monitoring skill, this deceptive behavior undermines trust and can cause users to rely on inaccurate summaries when evaluating their positions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file’s natural-language description and all user-facing output are fixed in Chinese, indicating the skill is designed to operate in a single language without any opt-in or fallback. Under the policy, locale or language constraints should either offer user choice or be clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The report implies that dividend estimates are computed from the user's holdings, but the logic uses fixed examples and generic assumptions instead of the actual portfolio. In an investment-assistant context, this is dangerous because users may rely on fabricated personalization when making financial decisions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script presents the report as portfolio-based but discards the actual user holdings and substitutes hard-coded simulated positions. In a finance skill, this can mislead users into acting on incorrect dividend expectations and undermines trust in the generated report.

Content

No source excerpt is available for this finding.