T09 · Insecure Skill Coding Practices
- Location
fetch_stock_list.py:26- Finding
Remote market data is written into executable Python modules without safe serialization
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent stock-scanning tool, but it needs Review because some included utilities can overwrite importable Python files with unvalidated market data and load code from outside the skill package.
Review carefully before installing. Run it only in an isolated environment, avoid the stock-pool fetch/rebuild scripts until they stop generating executable Python from remote data, and check the hard-coded .qclaw paths so it does not overwrite files you care about. Treat all financial output as research only, not investment advice.
fetch_stock_list.py:26Remote market data is written into executable Python modules without safe serialization
trend_scanner.py:31The main scanner imports executable code from an unaudited external workspace directory
skill.json:12Third-party dependencies are incomplete and not reproducibly pinned
The file presents all user-facing instructions and descriptions in Chinese, including the title, feature descriptions, usage guidance, and disclaimer. Under the policy criteria, forcing a specific language without user opt-in or documented justification can be a natural-language policy violation.
The module docstring and all user-facing console messages are written only in Chinese, indicating the skill is designed to operate in a fixed language without any visible opt-in or fallback. Under the policy, locale or language constraints should either be user-selectable or clearly justified as region-specific.
The module docstring says the strategy is for stocks scoring 70+ and the code logic enforces sig['total'] >= 70, but later output labels describe the strategy as '80分以上' and the file is named backtest_80plus_v2.py. This is an active contradiction in the skill's own documentation/output about what strategy is actually being evaluated.
This Python file presents its purpose and user-facing status/output text entirely in Chinese, starting with the module docstring and continuing throughout the script. Under the policy rule for natural-language violations, this is a locale/language constraint without any opt-in, fallback, or documented region-specific justification.
The script prepends a hard-coded external directory to sys.path and then imports executable Python modules from that location. In a skill context, this expands the trust boundary beyond the file itself: if that directory or the imported files are modified, the script will execute attacker-controlled code during import, which can lead to arbitrary code execution under the current user account.
The file's descriptive text, CLI description, and user-facing output are written entirely in Chinese, and stdout is explicitly configured for UTF-8 Chinese output. There is no indication that the user can choose another language or that the locale restriction is documented as an intentional region-specific limitation.
This Python file contains user-facing natural-language text entirely in Chinese, including the module description and later console messages, with no indication that language is configurable or limited to a justified region-specific use case. Under the policy rule for language/locale constraints, forcing a specific language without user opt-in is a natural-language policy violation.
This code file contains user-facing documentation and console output in Chinese, including the module docstring and later printed messages, but does not indicate that the skill is region-specific or provide any user opt-in for language selection. That creates a locale policy concern because the skill effectively forces a specific language on users.
The top-level docstring states that the file 'fetches the full A-share stock list' from the Eastmoney API. In practice, the script does substantially more: it excludes STAR Market, Beijing Exchange, ST, delisted, and several industry/name-based categories in filter_stocks, then persists the reduced set to a local file in save_pool. This is an active contradiction in stated intent versus actual behavior, not just an omitted implementation detail.
The script writes generated code to a hard-coded path inside a skills/workspace directory without user confirmation, path validation, or safe output controls. In an agent-skill context, silent file writes can overwrite trusted local files, introduce persistence, or modify downstream behavior if that generated file is later imported or executed by other tooling.
The module docstring at L003 and function docstring at L010 both state that the skill gets A-share stock lists from Tencent's API. However, the actual requests in the implementation go to Eastmoney endpoints at L026, L039, and L053, while the Tencent URL at L012 is never used. This is an active contradiction between documentation and code behavior.
The script writes a generated Python file to a hard-coded path inside a local workspace without user confirmation. In an agent/skill context, silent file creation or overwrite can modify code artifacts unexpectedly, potentially clobbering existing files or planting code that will later be imported and executed by other tooling.
The script writes a generated Python file to a hard-coded path under a specific user's workspace without prompting, validation, or ensuring the destination is intended. In an agent/skill context, silent filesystem modification is risky because it can overwrite project files, alter later-executed code, or fail unpredictably on other systems while the user may not realize a write occurred.
The module docstring says it retrieves a '完整A股列表' and the fetch function says it gets an 'A股列表', yet the script is configured to fetch hs_a, sh_b, and sz_b data and later removes B股, ST, delisted, sector-specific, and other stocks before saving. This is not just incomplete documentation; it materially contradicts the apparent intent conveyed by the docstrings of producing a complete A-share list.
The script writes a generated Python file to a hard-coded path under a user profile without confirmation, which can overwrite existing local content or unexpectedly modify a skill workspace. In an agent or automation context, silent filesystem writes are risky because they create side effects outside the caller’s immediate awareness and could corrupt trusted code or data.
The script writes directly to a fixed Python file path under a skill/workspace directory, replacing its contents without validation, backup, or confirmation. In an agent-skill context, this is dangerous because running the script mutates executable code on disk and could unintentionally corrupt a skill, overwrite trusted logic, or enable persistence if upstream data or local edits influence the generated output.
The script unconditionally writes a generated Python module to a hard-coded path under the user's workspace, which can overwrite an existing skill file without confirmation or validation. In an agent-skill context, modifying executable code in a fixed location is more dangerous than a normal data export because it can silently alter future agent behavior or destroy existing logic.
This Python file contains natural-language descriptions and user-facing output entirely in Chinese, beginning with the module docstring and continuing throughout the reporting strings. The file does not offer any language selection or explain that the skill is intentionally limited to a Chinese-speaking or region-specific context, which matches the policy's language/locale violation criterion.
This Python file contains user-facing natural-language descriptions and output strings entirely in Chinese, including the module docstring and later console messages. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified, which is not present here.
The module docstring says the prefilter automatically excludes ST, delisted stocks, STAR Market, liquor, banks, real estate, and names containing '地产'. However, the implementation also excludes stocks in the '证券' industry and any stock name containing '证券' at L666-L673. This is an active contradiction between stated intent and actual filtering behavior, not merely omitted implementation detail, because it changes which stocks are removed.
The module documentation says this script performs a historical backtest using historical K-line data to infer past TOP5 stocks and compute one-week returns. However, the executable defaults later use future dates (L216 and L394), which can yield no valid historical interval or otherwise fail to perform the documented historical backtest behavior.
The module docstring and all user-facing console output are fixed in Chinese, which imposes a specific language on users without opt-in. The policy requires either offering a language/locale choice or clearly documenting a justified locale restriction.
This code saves scan output to a CSV file and later writes a push-message text file containing recommendation/tracking information. Although the file paths are printed after writing, there is no prior disclosure or confirmation before persisting potentially sensitive financial analysis data to local storage.
The file's docstring and all user-facing console and push-message text are written in Chinese, and there is no option for users to select another language or indication that the skill is intentionally region- or locale-specific. This can violate a language/locale policy when skills must not force a specific language without user opt-in.
The module description, user-facing report strings, and test output are all written in Chinese, indicating the skill is designed to operate in a single language by default. There is no visible opt-in, locale selection, or documentation justifying the language constraint as region-specific.
No suspicious patterns detected.