T09 · Insecure Skill Coding Practices
- Location
scripts/setup.py:39- Finding
API Credentials May Be Transmitted to an Unvalidated Custom Endpoint
- Content
View full analysis
- Remediation
View remediation
str: parsed = urlparse(endpoint) if parsed.scheme != "https": raise ValueError("The API endpoint must use HTTPS") if parsed.hostname != "api.productai.photo": raise ValueError("Untrusted API endpoint hostname") if parsed.username or parsed.password: raise ValueError("Embedded URL credentials are not allowed") if parsed.port not in (None, 443): raise ValueError("Unexpected API endpoint port") return endpoint.rstrip("/") ``` ]]>
