Back to skill

Security audit

双色球预测技能 V3.6

Security checks for vulnerabilities and agentic risk

Overview

This looks like a lottery-prediction skill, but its package contains mismatched versions and an unrelated publishing script that could use the operator's ClawHub account if run.

Review before installing. The prediction feature itself appears to be local SQLite-based lottery analysis, but the package is not cleanly scoped: it mixes V3.6 and V2.15 files, dispatches prediction to the older script, includes unsupported performance claims, and bundles a publishing script that could publish a hardcoded skill directory using your ClawHub login if someone runs it. Do not run auto_publish.sh, and treat the lottery predictions as entertainment only, not as a way to make financial decisions.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/v2.15_prediction.py:55
Finding

SQL Query Manipulation Through an Unvalidated Table Identifier

Content
View full analysis
List[Dict]: """获取历史数据""" conn.row_factory = sqlite3.Row cursor = conn.cursor() query = f"SELECT * FROM {lottery_type} ORDER BY issue DESC" if limit: query += f" LIMIT {limit}" cursor.execute(query) rows = cursor.fetchall() return [dict(row) for row in rows] def get_latest_issue(conn: sqlite3.Connection, lottery_type: str = "ssq") -> str: """获取最新已开奖期号""" cursor = conn.cursor() cursor.execute(f"SELECT issue FROM {lottery_type} ORDER BY issue DESC LIMIT 1") row = cursor.fetchone() return row[0] if row else None ``` The value is obtained from a command-line argument without an allowlist: ```python parser.add_argument("--lottery", type=str, default="ssq", help="彩种(ssq/dlt)") ``` ### Technical Analysis The `--lottery` argument is directly interpolated into SQL statements as a table expression. Although the help text presents `ssq` and `dlt` as the expected values, the program does not enforce that restriction. SQL parameter binding cannot normally be used for table identifiers. Consequently, identifiers must be selected from a fixed mapping or strictly validated before interpolation. In the current implementation, an attacker who controls command-line arguments can supply SQL syntax instead of a valid table name. Python's SQLite driver generally prevents execution of multiple statements in one `execute()` call, but this does not eliminate manipulation within the single permitted statement. The `limit` value does not present the same issue in the normal CLI path because the application supplies a fixed integer of `3430`. The confirmed vulnerable so ...[truncated 1254 chars]
Remediation
View remediation
str: try: return LOTTERY_TABLES[lottery_type] except KeyError: raise ValueError("Unsupported lottery type") ``` Use only the resolved value when constructing SQL: ```python table = resolve_lottery_table(lottery_type) cursor.execute(f"SELECT issue FROM {table} ORDER BY issue DESC LIMIT 1") ``` Additional hardening should include: 1. Use `argparse` choices to reject invalid CLI input early: ```python parser.add_argument("--lottery", choices=["ssq", "dlt"], default="ssq") ``` 2. Continue using parameter binding for values such as limits and filters. 3. Open the database in read-only mode when prediction does not require writes: ```python sqlite3.connect(f"file:{db_path}?mode=ro", uri=True) ``` 4. Avoid returning raw database exception details to untrusted callers. 5. Add tests proving that spaces, quotes, comments, subqueries, and unknown lottery names are rejected. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
auto_publish.sh:1
Finding

Bundled Publishing Script Uses the Operator's Authenticated ClawHub Authority

Content
View full analysis
&1 | tee /tmp/publish_attempt_$ATTEMPT.log # 检查是否成功 if grep -q "Published" /tmp/publish_attempt_$ATTEMPT.log; then echo "✅ 发布成功!" echo "✅ 发布成功!" >> /Users/lic/.openclaw/workspace/skills/lottery-predictor-v2.15/PUBLISH_RESULT.md exit 0 else echo "❌ 失败,等待 30 分钟后重试..." echo "尝试 $ATTEMPT 失败:$(date '+%Y-%m-%d %H:%M:%S')" >> /Users/lic/.openclaw/workspace/skills/lottery-predictor-v2.15/PUBLISH_RESULT.md sleep 1800 # 30 分钟 fi ATTEMPT=$((ATTEMPT + 1)) done echo "❌ 已达到最大重试次数,发布失败" echo "❌ 已达到最大重试次数,发布失败" >> /Users/lic/.openclaw/workspace/skills/lottery-predictor-v2.15/PUBLISH_RESULT.md ``` The declared permissions conflict with this behavior: ```json "permissions": { "filesystem": "read", "network": "none", "execute": ["python3", "sqlite3"] } ``` ### Technical Analysis The script is unrelated to the core lottery-prediction operation. If manually or indirectly executed, it invokes `clawhub publish` using the current user's authenticated ClawHub context and uploads a hardcoded local directory. It also writes logs and status information despite the package declaring read-only filesystem access, and it performs network operations despite declaring `"network": "none"`. The script does ...[truncated 1942 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/verify.py:11
Finding

Optional Prediction Input Causes Division by Zero in Verification

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (29)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents the skill as a lottery prediction tool with a specific prediction/scoring model and performance claims. However, the supplied code does not implement any lottery analysis, scoring, prediction logic, or backtesting. Its sole function is operational: automating publication of a skill to ClawHub, monitoring success, logging attempts, and retrying on failure. This is a materially different primary purpose from the declared description, so it is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

该代码的总体方向确实是双色球预测工具,这一点与声明的高层目的基本一致;也没有发现额外敏感或越权能力,主要行为是读取本地彩票数据库并生成预测结果。但描述中的关键产品特征与代码实现存在多处实质性不一致:版本号不符(V3.6 vs V2.15)、评分维度数量不符(8 项 vs 7 项)、缺少‘金手指波动’特性,以及没有实现所宣称的 1000 期回测与 46.1% 命中率统计。因此这是明显的描述与行为不匹配,而不是仅仅措辞差异。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的核心用途是“预测工具”,重点在于生成双色球预测结果,并基于特定评分/波动模型给出预测能力与历史回测表现。实际代码仅是一个 verify.py 验证器,用于在已知预测号码和实际开奖号码后计算命中情况与奖级。两者主功能存在明显差异:代码没有任何预测生成、评分建模、历史数据处理或回测统计实现,因此描述未准确反映该代码块的实际行为。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The comments and visible skill metadata describe one artifact, while the script publishes a different path, slug, name, version, and changelog. These contradictions materially increase security risk because they can mislead operators and code reviewers, enabling accidental deployment of the wrong package or deliberate concealment of a substituted release target.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file is natural-language content, and it consistently forces a specific language/locale experience for readers and operators. Under the policy rule, a fixed language without user opt-in or justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The description block explicitly markets the skill as purely offline with no API calls, which contradicts the operational instructions elsewhere in the file for website publishing, CLI login, token use, and remote publication. This is an active documentation-level contradiction about the skill's behavior and deployment model, not merely an omitted detail.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file contains user-facing instructions exclusively in Chinese, including the title, steps, and support guidance. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file is presented as guidance for publishing this skill, but it repeatedly refers to lottery-predictor-v2.15 and version 2.15.0, while the manifest context for the analyzed skill is lottery-predictor-v3.6. This is not merely incomplete documentation; it actively points the operator at publishing/inspecting a different skill artifact than the one being described.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

整个技能说明从标题到使用示例均仅以中文提供,未说明是否支持其他语言,也未给出用户可选择语言的方式。按照该文件内容,技能面向一般用户而非明确限定的区域合规场景,因此这种默认单一语言要求可构成自然语言层面的语言/locale 策略违规。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file content is materially inconsistent with the declared skill purpose: instead of lottery prediction logic or user-facing functionality, it contains a monetization and payout playbook. This mismatch is dangerous because it can conceal the true operational intent of the skill, mislead reviewers and users, and indicate the package is optimized for revenue extraction rather than the claimed capability.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The invocation examples use very broad natural-language phrases such as asking to predict the next issue or show recent records, which could cause the skill to activate when a user is speaking generally rather than intentionally invoking it. In agent ecosystems, over-broad triggers can lead to unintended tool execution, unnecessary access to local data sources, or misleading outputs presented as user-authorized actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The report recommends publishing a lottery prediction skill without any warning that gambling can cause harm, that outputs are unreliable, or that users should not treat predictions as financial advice. In the context of a gambling-related skill, omission of risk disclosures can encourage unsafe user reliance and facilitate deceptive promotion of speculative predictions, increasing consumer harm and compliance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The update notes prominently advertise lottery prediction hit-rate claims and backtesting performance without any caution that outcomes are not guaranteed, may encourage gambling behavior, and should not be relied on for financial decision-making. In a gambling-adjacent skill, omission of risk disclosures can mislead users into overtrusting probabilistic output, especially when precise success metrics are presented as evidence of effectiveness.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script is presented as part of a lottery prediction skill, but its actual behavior is to repeatedly publish a different skill path and metadata (v2.15) unrelated to the declared artifact (v3.6). This mismatch is dangerous because it can cause unauthorized or unintended artifact publication, confuse reviewers, and hide supply-chain or release-process tampering behind an unrelated skill description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The package description is entirely in Chinese, which imposes a specific language on users without indicating any language choice or opt-in. The stated policy requires flagging language or locale constraints unless they are optional or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code advertises a Markov-chain model but only checks whether a number appeared in the immediately previous draw and assigns fixed scores accordingly. In a lottery-prediction skill, this is a deceptive mismatch between claimed statistical rigor and actual implementation, which can mislead users into overtrusting the output and making decisions on a false basis.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The docstring claims time-series trend and periodicity analysis, but the implementation merely counts occurrences in the last 10 draws. Because the skill markets itself as an advanced prediction tool, this discrepancy materially increases the risk of user deception by presenting a simplistic heuristic as a more sophisticated analytical model.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The function is labeled as using a Poisson distribution, but it actually computes how often adjacent numbers co-occur with a given number. In this skill context, falsely invoking a recognized statistical model can unduly persuade users that the predictions are mathematically grounded when they are not, creating a trust and integrity risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file contains natural-language docstrings and usage text entirely in Chinese, including the module description and function documentation. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This file contains user-facing natural-language instructions and status information exclusively in Chinese, including operational guidance and next steps. Under the policy rule for language/locale, forcing a single language without opt-in or justification can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file contains user-facing operational instructions only in Chinese, including headings, checklist items, commands context, and FAQs. Under the policy rule for language/locale, forcing a single language without opt-in or justification can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file presents the skill entirely in Chinese, including the title and release metadata, with no indication that users can choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the policy rule for language/locale constraints, a forced locale without opt-in or justification is a natural-language policy concern.

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 contains user-facing natural language exclusively in Chinese, including headings, status details, and action items. Under the policy, forcing a specific language without user opt-in can be a locale policy violation, and this file does not indicate that the skill is intentionally region-specific or that alternative language options are available.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file uses Chinese throughout and does not indicate that the skill or guide is intentionally limited to Chinese-speaking users. Under the language/locale policy check, forcing a single language without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document identifies a different skill/version (lottery-predictor-v2-15) than the manifest context (lottery-predictor-v3.6), creating provenance and integrity ambiguity. Such version/name discrepancies can hinder auditing, mask copied or repackaged content, and reduce confidence that the reviewed artifact matches what will be deployed.

Content

No source excerpt is available for this finding.