T07 · Tool Hijacking and Spoofing
- Location
scripts/astock_query.py:13- Finding
Predictable User-Controlled Import Path Enables Dependency Hijacking
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This stock-data skill mostly matches its stated purpose, but it handles API credentials and dependency loading in ways that deserve careful review before installation.
Install only if you are comfortable sending requested A-share symbols and your configured QGDATA_TOKEN to qgdata/QuantGo. Prefer setting QGDATA_TOKEN in the session environment instead of storing it in ~/.openclaw/.env, review or pin the qgdata dependency yourself, and be aware that the built-in trial token is shared and may fail or expose usage under a shared identity.
scripts/astock_query.py:13Predictable User-Controlled Import Path Enables Dependency Hijacking
SKILL.md:76Unpinned Third-Party Dependencies Create a Supply-Chain Risk
scripts/astock_query.py:49Shared API Credential Is Hardcoded in the Skill Source
The skill description materially misrepresents behavior by advertising unlimited, high-performance data access while also documenting a built-in shared token, local token loading, and upgrade/promotion flows. This is dangerous because users may unknowingly rely on undeclared external credential use and local resource access, reducing informed consent and increasing the chance of secret leakage or misuse of a shared credential.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
export QGDATA_TOKEN="your_personal_token_here"
echo "QGDATA_TOKEN=your_personal_token_here" >> ~/.openclaw/.env
#### 📊 免费额度说明
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
export QGDATA_TOKEN="your_personal_token_here"
# 或.env文件
echo "QGDATA_TOKEN=your_personal_token_here" >> ~/.openclaw/.env
```
#### 📊 免费额度说明
The code explicitly opens and parses ~/.openclaw/.env to retrieve a token, which is direct access to a user credential store. In the context of a market-data query skill, this is more dangerous because the functionality does not require broad secret-file access, and such patterns normalize secret harvesting from user home directories.
return token.strip()
# 从.env文件获取(用户自定义token)
env_path = os.path.expanduser("~/.openclaw/.env")
if os.path.exists(env_path):
try:
with open(env_path, 'r', encoding='utf-8') as f:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"config_commands": [
"export QGDATA_TOKEN='您的API密钥'",
"# 或添加到 ~/.openclaw/.env 文件",
"echo 'QGDATA_TOKEN=您的API密钥' >> ~/.openclaw/.env"
],
"benefits": [
"🔓 无限制API调用(告别每日1000次限制)",
Without declared permissions the skill's intent is opaque and cannot be validated.
The natural-language content of the skill, including its description and all usage instructions, is entirely in Chinese. Under the language/locale policy, forcing a specific language without user opt-in is a policy issue unless the locale constraint is explicitly documented and justified.
The skill omits a privacy warning even though it sends user-requested stock queries and API credentials to an external provider. This is risky because users may provide sensitive symbols, strategies, or personal API tokens without understanding that those inputs are transmitted off-platform to a third party.
The script reads credentials from both the environment and a user-scoped ~/.openclaw/.env file, which expands its privilege beyond a narrowly scoped market-data query tool. Accessing user credential stores increases the blast radius if the skill is repurposed, compromised, or simply used in an environment where the operator did not expect file-based secret harvesting.
The script contains a hardcoded fallback API token and will silently use it for network requests if no user token is present. Hardcoded shared credentials are dangerous because they can be abused by anyone with access to the code, can be revoked unpredictably, and may cause users to transmit requests under an unknown shared identity without informed consent.
The upgrade guide embeds marketing, pricing, registration URLs, and instructions to store API keys, which are outside the core function of returning stock data. This creates a capability mismatch where a data skill also acts as a promotional funnel, potentially steering users to disclose credentials or follow external links not necessary for the requested task.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"pro": "¥299/月 - 50万次调用",
"enterprise": "¥999/月 - 不限次数"
},
"register_url": "https://data.quantgo.ai/register",
"docs_url": "https://data.quantgo.ai/docs"
}
}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"pro": "¥299/月 - 50万次调用",
"enterprise": "¥999/月 - 不限次数"
},
"register_url": "https://data.quantgo.ai/register",
"docs_url": "https://data.quantgo.ai/docs"
}
}
On quota failures, the code returns upsell messaging promising expanded or 'unlimited' use rather than a minimal operational error. This is risky because it turns normal failure handling into account-conversion behavior, encouraging users to visit external sites and configure secrets when the manifest suggests only data-query behavior.
The top-level documentation says this is a professional A-share minute-data query script. Later code adds a dedicated test mode for quota exhaustion and constructs detailed commercialization/upgrade responses, which is an intent-level divergence from the module's stated role as a query tool.
The script description and all user-facing messages are written in Chinese, and there is no indication that the user can choose another language or that the tool is intentionally restricted to a Chinese-speaking context. This can violate language/locale policy when a skill imposes a specific language without opt-in or justification.
No suspicious patterns detected.