T09 · Insecure Skill Coding Practices
- Location
src/resource_hunter/adapters.py:742- Finding
Dalipan fallback disables TLS certificate verification
- Content
View full analysis
dict[str, Any]: try: payload = http_client.get_json(url, timeout=12) if isinstance(payload, dict): return payload raise SchemaError(f"invalid dalipan payload type: {type(payload).__name__}", source=self.name, url=url) except Exception as primary_error: request = urllib.request.Request(url, headers=DEFAULT_HEADERS | {"Accept": "application/json"}) try: with urllib.request.urlopen(request, timeout=12, context=ssl._create_unverified_context()) as response: payload = json.loads( response.read().decode(response.headers.get_content_charset() or "utf-8", errors="replace") ) except json.JSONDecodeError as exc: raise SchemaError(f"invalid json from {url}: {exc}", source=self.name, url=url) from exc except Exception as insecure_error: message = str(insecure_error) or str(primary_error) or "request failed" raise NetworkError(message, source=self.name, url=url) from insecure_error if not isinstance(payload, dict): raise SchemaError( f"invalid dalipan payload type: {type(payload).__name__}", source=self.name, url=url ) return payload ``` An equivalent legacy implementation also exists in `scripts/resource_hunter/precision_core.py`. ### Technical Analysis The normal Dalipan request uses standard TLS validation. However, any exception from that request causes the fallback path to call `ssl._create_unverified_context()`. This context disables verification of the server certificate and hostname. Consequently, HTTPS no longer authenticates `api.dalipan.com` during the f ...[truncated 2043 chars]- Remediation
View remediation
