T09 · Insecure Skill Coding Practices
- Location
scripts/fund-trading.py:32- Finding
OAuth Credentials and Bearer Tokens Transmitted over Plaintext HTTP
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This looks like a simulated fund-trading skill, but it needs Review because it mishandles credentials and has important security and documentation inconsistencies.
Review before installing. Treat this as simulated trading only, verify the exact package/version you install, avoid using valuable production credentials, run it in an isolated environment, and rotate any client secret that appears in logs or plaintext config. Be especially cautious because the code contradicts its HTTPS configuration documentation and stores authentication material insecurely.
scripts/fund-trading.py:32OAuth Credentials and Bearer Tokens Transmitted over Plaintext HTTP
scripts/fund-trading.py:83OAuth Client Secrets and Access Tokens Stored in Plaintext and Printed to Standard Output
SKILL.md:42Unpinned External Package Installation Bypasses Review of the Bundled Implementation
The manifest metadata presents the skill as a fund trading tool, while the description explicitly states it uses real fund prices but only virtual funds for simulated trading. In a finance context, this mismatch is dangerous because users or downstream agents may assume the skill can execute real trades or manage actual assets, leading to misuse, bad decisions, or unsafe integration into financial workflows.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def get_token(
client_id: str, client_secret: str, force_refresh: bool = False
) -> Optional[str]:
"""获取 OAuth 2.0 Access Token"""
config = load_config()
token_key = f"{client_id}"
The code persists client_id/client_secret and OAuth tokens in a local JSON file and also prints the client secret to the console during registration. This exposes highly sensitive credentials to local users, shell history/log capture, terminal recording, backups, or malware on the host, enabling unauthorized trading API access and account takeover.
The skill performs real-money subscribe, redeem, and cancel operations immediately from command-line arguments with no secondary confirmation, dry-run, or risk acknowledgment. In a trading tool, this creates a substantial chance of accidental or scripted misuse leading to irreversible financial loss or unauthorized transactions if the environment or invocation is compromised.
The changelog states that the tool uses real fund NAV/market data but only virtual simulated funds, while the skill metadata describes it as a live fund trading tool. In a financial context, this inconsistency can materially mislead users or downstream agents about whether transactions are real, causing unsafe reliance, improper approvals, or accidental exposure of users to production trading flows.
The manifest and README repeatedly describe the skill as a real fund trading tool, but the important notice explicitly says '真实基金净值,虚拟资金交易' and that it is only for learning, strategy testing, and simulated trading. This is a semantic mismatch about the core behavior and user impact of the skill, not a minor implementation detail.
Although the README states that funds are virtual, it also documents actionable trading operations such as subscription, redemption, and cancellation. The command list does not include a nearby warning that these operations place or alter simulated orders and may change account state, which is relevant user-impacting behavior.
The README documents local storage of client_id, client_secret, and access tokens in a plaintext config file under the user's home directory without warning about file permissions or credential sensitivity. If the host is multi-user, backed up insecurely, or compromised by other local malware/processes, these credentials can be exfiltrated and reused to access the trading APIs or impersonate the user/account.
The skill declares no explicit tool scope or allowed-tools despite documenting capabilities that require network access and local file reads/writes (configuration and token storage). Without a least-privilege declaration, an agent may grant broader access than users expect, increasing the blast radius if the skill is misused or compromised. In a finance/trading context, this is more sensitive because network calls and local credential/token storage can affect account integrity and expose authentication material.
The manifest scope focuses on 实盘交易能力 such as account management, fund lookup, subscriptions/redemptions, and asset queries. At L043 and in cmd_recommend, the skill additionally contacts a separate external recommendation service to retrieve marketing-style recommendation content, which is not clearly implied by the stated trading-tool description.
Registration silently stores and exposes sensitive client credentials without warning, increasing the chance users handle or share them insecurely. In a real-money trading context, these credentials can authorize API actions and expose account and asset data, so casual disclosure materially raises security risk.
The manifest description, headings, and operational instructions are predominantly in Chinese, and the file does not indicate that users can choose another language or locale. This can violate language/locale policy where skills should not force a specific language without explicit opt-in or documented justification.
The module docstring, examples, help text, and runtime messages are all presented only in Chinese, with no opt-in or language selection mechanism. This is a natural-language policy issue when a skill imposes a specific language or locale without giving the user a choice.