T09 · Insecure Skill Coding Practices
- Location
skills/linkfox-aba-intelligent-query/scripts/onboarding.py:70- Finding
Credential Exfiltration Through Unrestricted API Endpoint Overrides
- Content
View full analysis
Vulnerability Details
File Location:
skills/linkfox-aba-intelligent-query/scripts/onboarding.py:70-89, 209-222
Vulnerability Type: Credential-bearing requests to unvalidated, configurable destinations
Risk Level: HighAdditional affected implementations include:
skills/linkfox-aba-intelligent-query/scripts/aba_query.py:37-38, 62-71skills/linkfox-aigc-textgen/scripts/aigc_textgen.py:74-75, 308-333skills/linkfox-amazon-product-detail/scripts/amazon_product_detail.py:37-38, 62-71skills/linkfox-amazon-reviews-list/scripts/amazon_reviews.py:47-48skills/linkfox-amazon-search/scripts/amazon_search.py:37-38skills/linkfox-amazon-search-by-image/scripts/amazon_search_by_image.py:37-38skills/linkfox-amazon-search-by-image/scripts/upload_image.py:21, 52-75skills/linkfox-keepa-product-request/scripts/keepa_product_detail.py:37-38skills/linkfox-sellersprite-traffic-keyword/scripts/sellersprite_traffic_keyword.py:37-38- The duplicated
scripts/onboarding.pyfiles in the LinkFox API Skills skills/linkfox-file-upload/scripts/linkfox_paths.py:263-281
Representative vulnerable code:
python def _env_base(name: str, default: str, *fallbacks: str) -> 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", ) def _api_key() -> str: return ( os.environ.get("LINKFOX_AGENT_API_KEY") or os.environ.get("LINKFOXAGENT_API_KEY") ...[truncated 4553 chars]- Remediation
View remediation
Remediation Suggestions
- Implement a centralized endpoint validator that:
- Requires
https. - Rejects embedded credentials, fragments, and unexpected ports.
- Compares normalized hostnames against an explicit allowlist.
- Rejects IP literals, loopback, link-local, and private-network destinations unless an isolated development mode is explicitly enabled.
- Requires
- Allow production credentials only for exact approved hosts, such as the documented LinkFox API hosts.
- Use separate test credentials for custom development endpoints.
- Disable redirects for credential-bearing requests, or validate every redirect destination before following it.
- Do not attach
Authorization, access tokens, refresh tokens, or session metadata until destination validation succeeds. - Minimize metadata headers. Send
SESSION_ID,MESSAGE_ID,MODE_ID, andAPP_NAMEonly where the server contract requires them. - Add automated tests covering malicious schemes, deceptive subdomains, user-information syntax, redirects, and private IP addresses.
- Log only the validated hostname and never log authentication values or complete credential-bearing URLs.
- Implement a centralized endpoint validator that:
