T09 · Insecure Skill Coding Practices
- Location
scripts/kalodata_video_search.py:36- Finding
Redirectable API Endpoints Can Exfiltrate Credentials and Authentication Data
- Content
View full analysis
str: """Gateway base address: LINKFOX_TOOL_GATEWAY takes precedence.""" return (os.environ.get("LINKFOX_TOOL_GATEWAY") or "https://tool-gateway.linkfox.com").rstrip("/") def call_api(params): api_url = get_api_url() api_key = get_api_key() data = json.dumps(params).encode("utf-8") headers = { "Authorization": api_key, "Content-Type": "application/json", "User-Agent": "LinkFox-Skill/2.0", "SESSION_ID": os.environ.get("SESSION_ID", ""), "MESSAGE_ID": os.environ.get("MESSAGE_ID", ""), "MODE_ID": os.environ.get("MODE_ID", ""), "APP_NAME": os.environ.get("APP_NAME", ""), } req = Request(api_url, data=data, headers=headers, method="POST") ``` The onboarding client uses the same pattern for more sensitive authentication operations: ```python def _login_base() -> str: return _env_base("LINKFOX_LOGIN_API_URL", "https://api.linkfox.com") def _agent_user_base() -> str: return _env_base("LINKFOX_AGENT_USER_API_URL", "https://agent-api.linkfox.com") def _http_post(url: str, body: dict, headers: dict, timeout: int = 30) -> dict: try: r = requests.post(url, json=body or {}, headers=headers, timeout=timeout) return r.json() ``` ### Technical Analysis The destination hosts are selected from environment variables without enforcing HTTPS, validating the hostname, restricting ports, or applying an allowlist. Sensitive values are subsequently sent to the selected destinations. The video clients send the LinkFox API key in the `Authorization` header. T ...[truncated 1552 chars]- Remediation
View remediation
