T09 · Insecure Skill Coding Practices
- Location
scripts/data_service.py:16- Finding
Environment-Controlled API Endpoint Can Receive the Access Key
- Content
View full analysis
- Remediation
View remediation
str: if not base_url: raise ValueError("QIBOOK_BASE_URL is required") parsed = urlparse(base_url) if parsed.scheme != "https": raise ValueError("QIBOOK_BASE_URL must use HTTPS") if parsed.hostname not in APPROVED_HOSTS: raise ValueError("QIBOOK_BASE_URL uses an unapproved host") if parsed.username or parsed.password or parsed.fragment: raise ValueError("QIBOOK_BASE_URL contains prohibited components") if parsed.path not in ("", "/"): raise ValueError("QIBOOK_BASE_URL must not contain an unexpected path") return base_url.rstrip("/") ``` ]]>
