T09 · Insecure Skill Coding Practices
- Location
scripts/batch_scan_cup_handle.py:65- Finding
SQL Injection Through Unquoted SQLite Table Identifier
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This stock-pattern skill behaves like its description: it analyzes market data and saves local charts or reports, with one contained SQLite input-validation issue users should understand.
Install only if you are comfortable providing a Tushare token for market-data retrieval and writing generated charts/reports to local temp-style directories. For batch scans, use databases you trust or that follow the expected stock-table schema because crafted table names could affect query behavior or results.
scripts/batch_scan_cup_handle.py:65SQL Injection Through Unquoted SQLite Table Identifier
Referenced artifact was not completely inspected
python3 scripts/cup_handle_detector.py <股票代码>
Referenced artifact was not completely inspected
python3 scripts/cup_handle_detector.py <股票代码>
Referenced artifact was not completely inspected
python3 scripts/batch_scan_cup_handle.py --db <数据库路径>
Referenced artifact was not completely inspected
python3 scripts/batch_scan_cup_handle.py --db <数据库路径>
The skill advertises executable workflows that read environment variables (TUSHARE_TOKEN) and write generated chart files to a temporary directory, but the manifest does not declare any explicit tool scope or permissions. This creates an authorization and transparency gap: a caller or platform reviewer cannot tell from the skill declaration that it may access secrets or write files, which can lead to over-privileged execution or unexpected data handling.
The manifest description is entirely in Chinese, while the skill title and trigger set include English terms, suggesting mixed-language use but no explicit user choice of language. The policy requires avoiding language forcing unless the user is offered a language/locale choice or the constraint is clearly justified.
The script enumerates every table in the SQLite database and scans/ranks all stocks, which materially exceeds the skill description of answering stock-specific cup-and-handle queries. In an agent environment, this scope expansion can cause unintended bulk data processing, higher resource consumption, and broader-than-expected access to locally available market data.
This Python skill is a code file, so SQP-3 applies. The module docstring and subsequent user-facing strings are primarily Chinese by default, and the code automatically uses Chinese labels when a Chinese font is available rather than offering the user a language choice; this can violate language/locale policy when no opt-in is provided.
This markdown file uses a single fixed language throughout, and there is no indication that users may opt into Chinese or that the skill is region-specific. Under the policy rule, forcing a specific language without user choice is a natural-language policy concern.
The script persists a markdown report summarizing scan results in addition to generating charts, which is broader than the stated illustration-focused behavior. In a shared agent workspace, unexpected persistent outputs can create data retention and information exposure risks, especially if report contents are later consumed by other tools or users.
The manifest says the skill detects the pattern and generates an illustrative image, but the implementation persists that image under ~/temp by default and creates directories as needed. File creation may be an implementation detail, but the persistent write behavior is not explicit in the declared description.
The manifest describes a cup-and-handle detector for daily stock charts, but does not mention dependency on external credentials or runtime access to environment-stored API tokens. Reading TUSHARE_TOKEN and initializing a remote API client adds a credential-handling capability beyond the stated analytical purpose.