T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/stock_query.py:143- Finding
Undisclosed Access to a Shared Credential Vault
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This stock-quote skill mostly matches its purpose, but its Hong Kong stock path silently uses a local credential vault and runs another skill with broad environment access.
Review before installing. A and US quote lookups use a normal external market-data endpoint, but HK quote lookups can read an Eastmoney API key from a shared local vault and run another installed skill with broad environment access. Install only if you trust the publisher, the mx-finance-data skill, and the host environment, and prefer a revised version that discloses and scopes credentials and dependencies.
scripts/stock_query.py:143Undisclosed Access to a Shared Credential Vault
scripts/stock_query.py:155Full Environment and API Credential Passed to an Unreviewed External Skill
scripts/stock_query.py:175Unvalidated File Paths from an External Process Are Opened by an Excel Parser
SKILL.md:8Security-Relevant Dependencies and Credential Requirements Are Not Declared
A second description-versus-behavior mismatch reinforces that the skill omits mention of credential/file-system access and external helper execution while asserting no API key is needed. In security review terms, hidden secret consumption and undeclared cross-skill/script dependencies materially increase supply-chain and data-access risk because operators may approve a tool under false assumptions.
A second description-versus-behavior mismatch reinforces that the skill omits mention of credential/file-system access and external helper execution while asserting no API key is needed. In security review terms, hidden secret consumption and undeclared cross-skill/script dependencies materially increase supply-chain and data-access risk because operators may approve a tool under false assumptions.
The documentation states a no-key, Tencent-based strategy, but the implemented HK path actually uses an Eastmoney helper plus credential lookup. This discrepancy hides privileged behavior from users and reviewers, making the skill more dangerous because its real access pattern is broader than advertised.
The skill advertises that it requires no API key, but the Hong Kong stock path conditionally retrieves one from environment variables or a local vault file. That mismatch is security-relevant because it causes hidden credential use and undermines user expectations about what resources the skill will access.
The script reads a secret from a fixed vault path unrelated to a simple no-key quote lookup interface. Accessing local credentials expands the skill’s authority and creates unnecessary exposure of sensitive material if the script, helper, logs, or surrounding environment are compromised.
The script forwards the entire parent environment to a child process while also injecting EM_API_KEY. In an agent environment, inherited environment variables often contain unrelated secrets or tokens, so this unnecessarily broad propagation can expose sensitive data to the helper script and any of its transitive dependencies.
try:
import subprocess
env = {**os.environ, 'EM_API_KEY': em_api_key}
# 分两次查询:先获取最新价,再获取涨跌幅
result = subprocess.run(
['python3', '/root/.openclaw/workspace/skills/mx-finance-data/scripts/get_data.py',
The pattern copies the entire process environment and passes it to a child script, effectively broadening the child's access to all ambient secrets rather than only the one API key it needs. In an agent platform, environment variables often carry highly sensitive tokens, making this an unnecessary secret-harvesting and propagation risk even if exfiltration is not explicit in this file.
try:
import subprocess
env = {**os.environ, 'EM_API_KEY': em_api_key}
# 分两次查询:先获取最新价,再获取涨跌幅
result = subprocess.run(
['python3', '/root/.openclaw/workspace/skills/mx-finance-data/scripts/get_data.py',
The skill advertises executable behavior that implies shell, network, environment, and file access, but it does not declare any explicit tool scope or permissions. In an agent environment, missing scope boundaries increases the chance of overbroad execution and makes it harder to enforce least privilege, especially since the workflow runs Python scripts and may access local resources.
The activation guidance lists broad phrases such as “大盘怎么样” and keyword triggers like “查股票” / “股票行情” / “stock price” without clear exclusion conditions. These phrases are common and lack constraints on when the skill should or should not activate, increasing the risk of unintended invocation.
The script accesses a sensitive credential file without any user-facing disclosure, despite presenting itself as a straightforward market-data tool. Hidden secret access is dangerous because it normalizes privilege use without consent and can surprise operators who assume the tool is low-risk.
For a stock quote skill, fetching remote data is expected, but invoking another Python program through subprocess introduces code execution and trust in an external skill/toolchain. That is a broader capability than straightforward in-process quote retrieval and is not disclosed by the manifest's simple quote-query description.
The function invokes another Python script via subprocess.run to query external market data, but there is no clear warning to the user that an external helper script will be executed. This is a safety-relevant operation under the rule because subprocess execution can have system effects beyond simple in-process computation.
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
import subprocess
env = {**os.environ, 'EM_API_KEY': em_api_key}
# 分两次查询:先获取最新价,再获取涨跌幅
result = subprocess.run(
['python3', '/root/.openclaw/workspace/skills/mx-finance-data/scripts/get_data.py',
'--query', f'{code}.HK 最新价'],
capture_output=True,
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
# 第二次查询:获取涨跌幅
change_pct = 0
try:
result2 = subprocess.run(
['python3', '/root/.openclaw/workspace/skills/mx-finance-data/scripts/get_data.py',
'--query', f'{code}.HK 涨跌幅'],
capture_output=True,
The script sends stock query data to the Tencent finance endpoint over the network, but the user-facing description does not clearly warn that input symbols will be transmitted to third-party services. While remote fetching is part of the script's functionality, the current help text does not explicitly disclose the outbound network behavior.
The single-query function makes an HTTP request to the Tencent finance API, but there is no direct user-facing notice at this call site or in the command help that an external request will be made. This lacks the disclosure expected for network transmission of user-provided query data.
The skill metadata and comments claim no API key is required, but the Hong Kong quote path loads an Eastmoney API key from environment or a vault file. This is dangerous because it obscures secret usage from operators and users, undermining informed consent and making the skill appear less sensitive than it really is.
The script reads a credential file from a fixed vault path as part of ordinary quote lookup behavior, expanding the skill's privilege and secret-access scope beyond what its simple functionality suggests. In shared agent environments, hardcoded secret-path access can expose unrelated credentials to code paths that should not need them.
The skill accesses credentials and sends data to external services without clearly disclosing that behavior to the user. Lack of transparency is risky in agent settings because users may assume a harmless local lookup while the code actually consumes secrets and communicates with third parties.
The skill delegates work to a Python script located in another skill's directory, creating a risky trust-boundary crossing. If that external skill is modified, compromised, or less trusted, this stock-query skill becomes a vehicle for executing unreviewed code with access to its inherited secrets and runtime context.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
import subprocess
env = {**os.environ, 'EM_API_KEY': em_api_key}
# 分两次查询:先获取最新价,再获取涨跌幅
result = subprocess.run(
['python3', '/root/.openclaw/workspace/skills/mx-finance-data/scripts/get_data.py',
'--query', f'{code}.HK 最新价'],
capture_output=True,
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
import subprocess
env = {**os.environ, 'EM_API_KEY': em_api_key}
# 分两次查询:先获取最新价,再获取涨跌幅
result = subprocess.run(
['python3', '/root/.openclaw/workspace/skills/mx-finance-data/scripts/get_data.py',
'--query', f'{code}.HK 最新价'],
capture_output=True,
The code forwards the entire parent environment into an external Python script from another skill while also injecting an API key. In a skill-execution environment, inherited environment variables may contain credentials, tokens, or internal configuration, so this creates a cross-skill secret exposure channel if the helper script is compromised or behaves unexpectedly.
import subprocess
env = {**os.environ, 'EM_API_KEY': em_api_key}
# 分两次查询:先获取最新价,再获取涨跌幅
result = subprocess.run(
['python3', '/root/.openclaw/workspace/skills/mx-finance-data/scripts/get_data.py',
'--query', f'{code}.HK 最新价'],
capture_output=True,
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 第二次查询:获取涨跌幅
change_pct = 0
try:
result2 = subprocess.run(
['python3', '/root/.openclaw/workspace/skills/mx-finance-data/scripts/get_data.py',
'--query', f'{code}.HK 涨跌幅'],
capture_output=True,
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
# 第二次查询:获取涨跌幅
change_pct = 0
try:
result2 = subprocess.run(
['python3', '/root/.openclaw/workspace/skills/mx-finance-data/scripts/get_data.py',
'--query', f'{code}.HK 涨跌幅'],
capture_output=True,
No suspicious patterns detected.