Back to skill

Security audit

Cup and Handle Pattern Detector

Security checks for vulnerabilities and agentic risk

Overview

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.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/batch_scan_cup_handle.py:65
Finding

SQL Injection Through Unquoted SQLite Table Identifier

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 45)May include surrounding context.

md
python3 scripts/cup_handle_detector.py <股票代码>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 54)May include surrounding context.

md
python3 scripts/cup_handle_detector.py <股票代码>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 48)May include surrounding context.

md
python3 scripts/batch_scan_cup_handle.py --db <数据库路径>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 55)May include surrounding context.

md
python3 scripts/batch_scan_cup_handle.py --db <数据库路径>

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
73% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

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.

Content

No source excerpt is available for this finding.