T09 · Insecure Skill Coding Practices
- Location
scripts/_spapi_ef_common.py:22- Finding
Credentials and Restricted Fulfillment Data Can Be Redirected to Arbitrary Hosts
- Content
View full analysis
dict: api_key = get_api_key() data = json.dumps(params).encode("utf-8") req = Request( endpoint, data=data, headers={ "Authorization": api_key, "Content-Type": "application/json", "User-Agent": "LinkFox-Skill/1.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", ""), }, method="POST", ) try: with urlopen(req, timeout=150) as response: return json.loads(response.read().decode("utf-8")) except HTTPError as e: body = e.read().decode("utf-8") if e.fp else "" return {"error": f"HTTP {e.code}: {e.reason}", "details": body} except URLError as e: return {"error": f"Connection failed: {e.reason}"} def get_store_tokens(seller_id: str, region: str) -> dict: return call_api(STORE_TOKENS_ENDPOINT, {"sellerId": seller_id, "region": region}) ``` The onboarding workflow has equivalent configurable endpoints: ```python def _ag ...[truncated 4977 chars]- Remediation
View remediation
