T09 · Insecure Skill Coding Practices
- Location
scripts/factcheck.py:19- Finding
Sensitive fact-check queries can be transmitted to an external search provider
- Content
View full analysis
bool: q = query.lower() return any(re.search(p, q) for p in BLOCKED_PATTERNS) def search_duckduckgo_html(query: str, max_results: int = 5): """ Uses DuckDuckGo's HTML-only endpoint (no JS, no API key required). This is a best-effort, dependency-free fallback search. It is meant for casual fact verification, not high-volume scraping. """ url = "https://html.duckduckgo.com/html/?" + urllib.parse.urlencode({"q": query}) req = urllib.request.Request(url, headers={"User-Agent": USER_AGENT}) try: with urllib.request.urlopen(req, timeout=10) as resp: html = resp.read().decode("utf-8", errors="replace") ``` ### Technical Analysis The fact-check capability legitimately requires outbound network access, and the audited code sends requests only to DuckDuckGo's HTTPS search endpoint. However, the confidentiality control is a small keyword denylist rather than a reliable sensitive-data boundary. Queries containing terms such as `token`, `secret`, `API key`, session cookies, private-key material, email addresses, customer identifiers, or unlisted internal hostnames are not rejected. Any accepted query is URL-encoded and transmitted to the external provider. The script does not autonomously read local credentials, and no covert collection mechanism was identified. Exploitation therefore requires sensitive information to be placed in the query by a user, agent, or upstream workflow. ### Attack ...[truncated 853 chars]- Remediation
View remediation
