T09 · Insecure Skill Coding Practices
- Location
scripts/wime_auth.py:14- Finding
WIME credentials and user images can be redirected to an arbitrary endpoint
- Content
View full analysis
Vulnerability Details
File Location:
scripts/wime_auth.py, lines 14-43
Vulnerability Type: Unvalidated authentication endpoint configuration
Risk Level: HighVulnerable Code
python BASE_URL = os.environ.get("WIME_BASE_URL", "https://wime-ai.com") ACCESS_TOKEN = os.environ.get("WIME_ACCESS_TOKEN", "") def get_auth( method: str = "POST", uri_path: str = "", body_dict: Optional[dict] = None, content_type: str = "application/json", ) -> dict: """Generate WIME access-token request configuration.""" if not ACCESS_TOKEN: raise ValueError( "WIME_ACCESS_TOKEN is not configured." ) headers = {"access-token": ACCESS_TOKEN} body_str = None if body_dict is not None: body_str = json.dumps( body_dict, separators=(",", ":"), sort_keys=True, ensure_ascii=False ) headers["Content-Type"] = content_type return { "base_url": BASE_URL, "headers": headers, "body_str": body_str, }The returned
base_urland authentication headers are subsequently used together in documented API requests:python resp = requests.post( f"{auth['base_url']}/waic/core/creationDesk/draw", headers=auth["headers"], data=auth["body_str"].encode("utf-8") )Technical Analysis
WIME_BASE_URLis accepted directly from the process environment without scheme or hostname validation. The generated request configuration attaches the complete WIME access token to requests sent to that endpoint.The Skill documentation also uses this configurable endpoint for multipart image uploads. Therefore, control over
WIME_BASE_URLpermits redirection of both authentication credentials and explicitly selected user images. The override also permits plaintexthttp://endpoints, which would expose data to network i ...[truncated 1225 chars]- Remediation
View remediation
Remediation Suggestions
- Remove
WIME_BASE_URLconfigurability in production and use the fixed documented WIME endpoint. - If endpoint overrides are required, enforce
https, reject embedded credentials, and restrict hosts to an explicit allowlist. - Separate development and production credentials so production tokens cannot be sent to test endpoints.
- Resolve and validate the destination before sending credentials, rejecting loopback, private, link-local, reserved, and multicast addresses.
- Disable automatic cross-origin redirects for authenticated requests. If redirects are necessary, validate every destination and strip credentials whenever the origin changes.
- Fail closed when endpoint validation is unsuccessful.
- Document and enforce narrow server-side token scopes, expiration, revocation, and rotation.
- Remove
