T09 · Insecure Skill Coding Practices
- Location
scripts/analyze_stock.py:48- Finding
Path Traversal Through Unsanitized Default Report Filename
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This stock-analysis skill needs review because it can turn simulated or hardcoded market data into concrete buy/sell-style recommendations.
Install only if you treat it as a demo or prototype. Do not rely on its ratings, scores, or buy/sell suggestions for financial decisions unless the publisher replaces the simulated market and financial data with verified sources, labels synthetic/demo output clearly, constrains report writes, and documents network and file permissions.
scripts/analyze_stock.py:48Path Traversal Through Unsanitized Default Report Filename
requirements.txt:4Unpinned and Unhashed Third-Party Dependencies
The skill claims broad stock-analysis functions, including real-time quotes, technical indicators, CSI 2000 batch analysis, and sentiment analysis, but the finding states these are absent or only partially present, while external network access to third-party endpoints is used without declaration. This combination is risky because it couples deceptive capability claims with undisclosed outbound communication in a domain where users may act on the results financially.
The skill claims broad stock-analysis functions, including real-time quotes, technical indicators, CSI 2000 batch analysis, and sentiment analysis, but the finding states these are absent or only partially present, while external network access to third-party endpoints is used without declaration. This combination is risky because it couples deceptive capability claims with undisclosed outbound communication in a domain where users may act on the results financially.
The skill claims broad stock-analysis functions, including real-time quotes, technical indicators, CSI 2000 batch analysis, and sentiment analysis, but the finding states these are absent or only partially present, while external network access to third-party endpoints is used without declaration. This combination is risky because it couples deceptive capability claims with undisclosed outbound communication in a domain where users may act on the results financially.
The function is documented and named as if it retrieves real historical stock market data, but it actually fabricates synthetic random OHLCV values. In an investment-analysis skill, this can directly mislead downstream indicator calculations and trading decisions while presenting false data as authentic market information.
The function claims to return company financial statements but instead returns hardcoded placeholder values, creating a false impression of factual financial analysis. In a stock analysis tool, fabricated revenue, profit, and ratio data can materially distort recommendations and cause users to act on nonexistent fundamentals.
The entire skill description, examples, and operational guidance are written exclusively in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking or China-only compliance context. Under the policy, a language constraint without user opt-in or explicit justification is a natural-language policy violation.
The manifest describes the skill as supporting real-time market data retrieval, technical indicator analysis, caching, and news sentiment analysis. This README adds a substantial separate capability area—financial statement analysis including ROE, debt service, cash flow, R&D spending, PEG, and free cash flow—which is not reflected in the manifest description and materially broadens the skill’s stated purpose.
The manifest focuses on obtaining quotes, technical signals, batch analysis, sentiment monitoring, and caching. The README’s sample output goes further by claiming concrete investment ratings and action recommendations such as '建议买入,逢低加仓', which changes the skill from an analysis utility into an advisory/recommendation system.
The stated purpose is stock analysis, sentiment monitoring, technical indicators, and caching. Mentioning extension to real brokerage/trading interfaces and automated trading introduces a materially different capability with real-world action-taking consequences that is not justified by the declared scope of an analysis skill.
The skill advertises capabilities that imply network access, local file writes, and possible environment use, but it does not declare any tool scope or permissions. This is dangerous because users and the host platform cannot accurately constrain or review what the skill may access, increasing the risk of unintended data exposure or unauthorized external communication.
The manifest description and main documentation are written entirely in Chinese and present the skill as a general stock analysis tool, but they do not offer any language or locale choice. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is clearly documented and justified.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
return []
try:
url = "https://api.tavily.com/search"
headers = {"Content-Type": "application/json"}
payload = {
"api_key": self.tavily_api_key,
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"max_results": 20
}
response = requests.post(url, json=payload, headers=headers, timeout=30)
if response.status_code == 200:
data = response.json()
return data.get('results', [])
This Python file contains natural-language descriptions entirely in Chinese, beginning with the module docstring and continuing through generated summary strings. Because the skill does not provide any user opt-in, language selection, or justification that it is intended only for a Chinese-language context, it violates the language/locale policy criterion.
The manifest describes a stock analysis tool centered on real-time行情、技术指标分析(MACD/KDJ/RSI/EMA)、缓存和新闻舆情, but this module performs extensive fundamental financial-statement analysis such as ROE、资产负债率、现金流、研发支出、PEG and management/strategy scoring. That is a meaningful capability expansion beyond the declared behavior, not just an implementation detail of technical analysis.
This code hard-codes Chinese natural-language strings throughout the module, including the main description, generated report text, CLI usage, and disclaimer, without offering any language selection or opt-in. That creates a locale policy issue because the skill effectively mandates a specific language for all users rather than allowing a choice or documenting a justified region-specific restriction.
This code's natural-language description specifies the module behavior entirely in Chinese, and the generated user-facing report is also hard-coded in Chinese throughout the file. Under the policy rule for language/locale, forcing a specific language without user opt-in is a violation unless a justified region-specific constraint is documented, which is not present here.
The report content, labels, recommendations, and disclaimer are all emitted as Chinese strings, with no mechanism for the user to choose another language. This constitutes a language/locale policy issue because the skill imposes a specific language on end users without opt-in or documented justification.
This Python file contains multiple Chinese docstrings, comments, error messages, and CLI usage text, which effectively forces a specific language for users and maintainers. Under the policy, language constraints should either offer user choice or be clearly documented as region- or locale-specific.
This code presents its description, argument help text, and user-facing messages entirely in Chinese, which imposes a specific language on users without any opt-in or alternative locale path. Under the policy, forcing a language without user choice is a natural-language policy violation unless clearly justified as region-specific.
The file’s human-facing comments and labels are entirely in Chinese, which indicates a fixed language/locale presentation. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation when no alternative or opt-in is documented.
This code file contains natural-language documentation entirely in Chinese ('数据获取模块 - 从公开数据源获取股票数据、新闻、财报等信息') with no indication that language choice is optional. Under the policy rule for language/locale, forcing a specific language without user opt-in can be a violation when no justification or alternative is provided.
The comment and returned fields suggest dynamic adjustment based on news or analyst forecast data (e.g. '可根据新闻调整', '可接入分析师预测数据'), but the code always returns fixed values like '正面' and fixed growth forecast strings. This documentation signals a capability or behavior that the function does not actually implement.
This Python file contains user-facing natural-language descriptions in Chinese, and the module appears oriented around Chinese-language output without any indication that users can opt into another language. The policy requires flagging language or locale constraints when a specific language is forced without user choice or explicit justification.
The manifest describes stock analysis, technical indicators, news sentiment, and data caching, but does not mention generating and persisting report files to the local filesystem. Writing a dated report file is additional behavior beyond the described analysis-focused scope, even though it is not highly risky.