T09 · Insecure Skill Coding Practices
- Location
scripts/analyser.py:123- Finding
Unauthenticated HTTP Transport Allows Market-Data Response Manipulation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a disclosed stock-monitoring skill that runs a user-started background watcher and contacts market-data providers, with some quality and hardening issues but no hidden or destructive behavior found.
Before installing, be aware that this skill is aimed at Chinese-speaking China-market workflows, runs as a local background process when started, logs under ~/.stock_monitor, and sends your configured watchlist symbols to external market-data/news services. Treat its alerts and advice as informational, and prefer hardening the HTTP endpoint and PID validation before relying on it heavily.
scripts/analyser.py:123Unauthenticated HTTP Transport Allows Market-Data Response Manipulation
scripts/control.sh:24Stale or Manipulated PID File Can Terminate an Unrelated User Process
If the shipped code is primarily developer QA or validation infrastructure while the skill is presented as end-user monitoring functionality, reviewers and users may misunderstand what actually runs. This is dangerous because test harnesses often have broader access, weaker hardening, or behavior inconsistent with production claims, which can expand attack surface and reduce transparency.
If the shipped code is primarily developer QA or validation infrastructure while the skill is presented as end-user monitoring functionality, reviewers and users may misunderstand what actually runs. This is dangerous because test harnesses often have broader access, weaker hardening, or behavior inconsistent with production claims, which can expand attack surface and reduce transparency.
If the shipped code is primarily developer QA or validation infrastructure while the skill is presented as end-user monitoring functionality, reviewers and users may misunderstand what actually runs. This is dangerous because test harnesses often have broader access, weaker hardening, or behavior inconsistent with production claims, which can expand attack surface and reduce transparency.
The README presents the skill name's description, feature list, and setup note entirely in Chinese, which effectively forces a specific language for users. The policy allows locale constraints only when they are optional or clearly documented and justified, which is not present here.
The skill documentation declares no explicit tool scope or permissions, while the accompanying analysis indicates network-capable behavior exists elsewhere in the skill. Missing scope declarations are dangerous because they hide the true execution and data-access surface from reviewers and users, making unexpected external requests harder to audit and constrain.
The manifest describes a stock monitoring and alerting system centered on seven specific warning rules such as cost percentage, moving-average crosses, RSI, volume anomalies, gaps, and trailing take-profit. This file's module description and implemented methods instead expand into broader market-intelligence functions including news scraping, sentiment analysis, capital-flow retrieval,龙虎榜 data, and gold-price correlation analysis, which are materially beyond the described alert-rule scope.
The file-level description and class docstring are entirely in Chinese and present the skill as a general-purpose stock analysis engine, with no indication that language is configurable or limited to a China-specific deployment context. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
echo "🚀 启动 Stock Monitor 后台进程..."
mkdir -p "$LOG_DIR"
nohup python3 "$SCRIPT_DIR/monitor_daemon.py" > "$LOG_DIR/monitor.log" 2>&1 &
echo $! > "$PID_FILE"
echo "✅ 已启动 (PID: $!)"
echo "📋 日志: $LOG_DIR/monitor.log"
The file's natural-language description and user-facing alert messages are entirely in Chinese, and locale-specific conventions are embedded in comments and output formatting. There is no indication that the language is configurable or that the skill is intentionally restricted to a Chinese-speaking or China-specific context with explicit user opt-in.
The module docstring uses Chinese for core operational descriptions, and the file continues to use Chinese user-facing strings in logs. Under the policy rule, forcing a specific language without opt-in or justification is a natural-language policy violation.
The module docstring is entirely in Chinese and presents the test suite description in a single fixed language. This is a natural-language locale policy concern because the file does not offer an opt-in language choice or explain why Chinese is required for a region-specific audience.
The description states the skill '符合中国投资者习惯(红涨绿跌)', which bakes in a China-specific market display convention by default. The file does not indicate that users can choose their preferred color/locale convention or that this behavior is limited to a region-specific deployment.
These lines explicitly define '红色 = 上涨 / 盈利' and '绿色 = 下跌 / 亏损' as the skill's convention. Because color semantics vary by market and locale, hardcoding this behavior without opt-in or a documented locale scope creates a language/locale policy issue.
The function is documented as analyzing the relationship between gold price and portfolio stocks, implying the input gold_price affects the analysis. In reality, the code never uses gold_price and simply looks up stock codes in a fixed correlation_map, so the documented intent contradicts the actual behavior.
The script's comments, status messages, and usage output are presented entirely in Chinese, including operational prompts shown during start, stop, status, and help flows. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified.
The skill sends the user-configured watchlist symbols and market interests to third-party data providers without any user-facing notice or consent flow. While the transmitted data is not highly sensitive by itself, investment interests can still reveal private financial preferences and behavior patterns, especially if correlated over time by external services.
The manifest describes a stock monitoring and alerting system centered on seven warning-rule types. This function adds a separate news retrieval capability, which is not referenced in the manifest description and is not necessary to implement the stated alert rules.
The skill's stated purpose is monitoring stocks and generating technical/price-based alerts. Accessing a company survey/news endpoint is a separate informational capability and is not obviously required for the declared alerting behavior, especially since the returned value is only a placeholder string.