T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/ssq_lottery.py:31
- Finding
- Prioritized Official Data Sources Use Unauthenticated Cleartext HTTP## Vulnerability Details **File Location**: `scripts/ssq_lottery.py:31-41` **Vulnerability Type**: Cleartext transmission of integrity-sensitive lottery data **Risk Level**: Medium ### Vulnerable Code ```python { 'name': '中国福彩网', 'url_list': 'http://kaijiang.zhcw.com/zhcw/html/ssq/list.html', 'url_issue': 'http://kaijiang.zhcw.com/zhcw/html/ssq/{issue}.html', 'priority': 'official', 'timeout': 15, }, { 'name': '福彩网手机版', 'url_list': 'http://m.zhcw.com/ssq/', 'url_issue': 'http://m.zhcw.com/ssq/{issue}.html', 'priority': 'official_backup', 'timeout': 15, }, ``` ### Technical Analysis The first two and most trusted data sources use HTTP rather than HTTPS. HTTP does not authenticate the remote endpoint and does not protect response integrity. An attacker capable of observing or modifying the network path can replace the returned HTML before it reaches the parser. Because these sources have the highest priority, manipulated responses can be labeled and displayed as official data. The skill documentation also recommends the same cleartext endpoints, making the insecure behavior part of the documented workflow. ### Attack Path 1. A user invokes the skill to retrieve current or historical lottery results. 2. The script connects to one of the prioritized official sources over HTTP. 3. An attacker controlling a local network, proxy, gateway, DNS path, or other intermediary intercepts the request. 4. The attacker returns modified HTML containing fabricated issue, date, ball, or prize-pool values. 5. The parser extracts the attacker-controlled values. 6. The script presents the result as originating from an official source. ### Impact Assessment Exploitation does not grant local code execution, filesystem access, or elevated system privileges. Its scope is the integrity and authenticity of financially relevant lottery information returned by the skill. An attacke ...[truncated 121 chars]
- Remediation
- ## Remediation Suggestions - Replace all HTTP endpoints with verified HTTPS endpoints. - Reject redirects from HTTPS to HTTP. - Retain normal certificate and hostname verification; do not introduce an unverified TLS context. - Fail closed when an official endpoint is unavailable over authenticated transport rather than silently downgrading to HTTP. - Clearly distinguish official and third-party data after transport and content validation. - Update `SKILL.md` and `references/data_sources.md` so they no longer recommend cleartext URLs. - Add automated tests that assert every configured endpoint uses HTTPS and that downgrade redirects are rejected.
