T09 · Insecure Skill Coding Practices
- Location
lib/check_url.py:27- Finding
Public suffix allowlisting bypasses all phishing detection
- Content
View full analysis
bool: """Check if domain is in whitelist.""" root = get_root_domain(domain) for w in WHITELIST: if domain == w or domain.endswith("." + w) or root == w: return True return False ``` ```python # Whitelist check if is_whitelisted(domain): return { "url": url, "domain": domain, "risk_level": "low", "risk_level_zh": "安全", "matched_source": None, "reasons": [], "message": f"{domain} 未發現已知風險。", } ``` ### Technical Analysis The allowlist contains public registration suffixes such as `com.tw` and `org.tw`. The `domain.endswith("." + w)` condition consequently trusts every registrable domain beneath those suffixes. Allowlist evaluation occurs before blocklist and heuristic evaluation. Once a suffix match is found, the function immediately returns a low-risk result. This means that neither a blocklist entry nor obvious phishing characteristics can override the allowlist decision. This is a fail-open trust-boundary error: public namespace suffixes are treated as if they were individually con ...[truncated 1130 chars]- Remediation
View remediation
