T09 · Insecure Skill Coding Practices
- Location
scripts/flow_api.py:52- Finding
Bearer Token Can Be Forwarded to an Unrestricted Network Destination
- Content
View full analysis
str: if provided: return provided.rstrip("/") val = os.environ.get( "FLOWBOARD_BASE_URL", "https://mycivgjuujlnyoycuwrz.supabase.co/functions/v1/api-gateway", ) return val.rstrip("/") ``` ```python api_key = get_api_key(args.api_key) base_url = get_base_url(args.base_url) query = parse_query_params(args) parent_id = getattr(args, "parent_id", None) resource_id = getattr(args, "id", None) http_method_map = { "list": "GET", "get": "GET", "create": "POST", "update": "PATCH", "delete": "DELETE", "archive": "POST", "unarchive": "POST", } url = base_url + build_url(args.resource, args.action, resource_id, parent_id) try: if args.action in ("list", "get", "archive", "unarchive"): body = None params = query if args.action == "list" else None resp = httpx.request( http_method_map[args.action], url, headers={"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}, params=params, json=body, timeout=30, ) ``` From `scripts/flowboard_api.py`: ```python BASE_URL = os.environ.get( "FLOWBOARD_BASE_URL", "https://mycivgjuujlnyoycuwrz.supabase.co/functions/v1/api-gateway", ) ``` ```python def build_url(path, query): url = f"{BASE_URL.rstrip('/')}/{path.lstrip('/')}" if query: url = f"{url}?{urlencode(query, doseq=True)}" return url ``` ```python url = build_url(args.path, query) headers = { "Authorization": f"Bearer {api_key}", "Accep ...[truncated 3129 chars]- Remediation
View remediation
