T09 · Insecure Skill Coding Practices
- Location
scripts/onboarding.py:71- Finding
Environment-controlled API endpoints can exfiltrate credentials and authentication tokens
- Content
View full analysis
str: for n in (name, *fallbacks): v = os.environ.get(n) if v: return v.rstrip("/") return default.rstrip("/") def _agent_base() -> str: return _env_base( "LINKFOX_AGENT_API_URL", "https://tool-gateway.linkfox.com", "LINKFOX_TOOL_GATEWAY", ) 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", ) ``` These values are subsequently used for requests carrying phone numbers, SMS verification codes, access tokens, refresh tokens, API keys, user IDs, and team identifiers: ```python r = requests.post(url, json=body or {}, headers=headers, timeout=timeout) ``` ```python resp = _http_post(f"{_agent_user_base()}/account/loginByToken", { "token": access_token, "refreshToken": refresh_token, "device": {"aid": "3026344186", "did": "", "type": "Windows", "os": "10", "model": "149.0.0.0", "brand": "Chrome"}, }, _headers("agent-linkfox-web", "agent.linkfox.com", access_token=access_token)) ``` ```python resp = _http_post( f"{_login_base()}/linkFoxApp/api/userCenter/userInfo", {}, _headers( "agent-linkfox-web", "agent.linkfox.com", access_token=access_token, user_id=user_id, ), ) ``` The same pattern exists in `scripts/amazon_alexa_search.py:37-80`, where `LINKFOX_TOOL_GATEWAY` controls the destination receiving the API key, session metadat ...[truncated 2089 chars]- Remediation
View remediation
