T09 · Insecure Skill Coding Practices
- Location
scripts/flow_api.py:66- Finding
Bearer Credentials Can Be Forwarded to an Untrusted Configurable Endpoint
- Content
View full analysis
Vulnerability Details
File Location:
scripts/flow_api.py, lines 66–69 and 132–141
Vulnerability Type: Unrestricted transmission of credentials and sensitive data
Risk Level: HighVulnerable Code
python def get_base_url(provided: str | None) -> str: if provided: return provided.rstrip("/") val = os.environ.get("FLOWDECK_BASE_URL", "https://mycivgjuujlnyoycuwrz.supabase.co/functions/v1/api-gateway") return val.rstrip("/")python def make_request(method: str, url: str, api_key: str, query_params: dict | None = None, body: dict | None = None): headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json", } response = httpx.request( method, url, headers=headers, params=query_params, json=body, timeout=30, ) return responseTechnical Analysis
The API base URL is read directly from the
FLOWDECK_BASE_URLenvironment variable without validation. The implementation does not enforce HTTPS, verify that the destination belongs to FlowDeck or the expected Supabase deployment, reject embedded user information, or restrict nonstandard ports.Every request subsequently sends the FlowDeck API key in the
Authorizationheader. Create and update requests may also include sensitive CRM information in the JSON body, such as contact details, addresses, financial information, and tax identifiers.Consequently, any party capable of influencing the runtime environment can redirect authenticated requests to an endpoint under its control. This turns the configurable base URL into a credential- and data-forwarding mechanism.
Attack Path
- An attacker, compromised launcher, or unsafe execution environment sets
FLOWDECK_BASE_URLto an attacker-controlled HTTP or HTTPS endpoint. - The user or agent invokes ...[truncated 993 chars]
- An attacker, compromised launcher, or unsafe execution environment sets
- Remediation
View remediation
Remediation Suggestions
- Permit only HTTPS endpoints in production.
- Parse the configured URL using a standard URL parser and reject malformed URLs, embedded credentials, fragments, unexpected ports, and non-HTTPS schemes.
- Maintain an explicit allowlist of approved FlowDeck or Supabase hostnames rather than accepting arbitrary destinations.
- If development endpoints are required, enable them only through an explicit development mode that does not use production credentials.
- Do not attach the
Authorizationheader until the destination has passed validation. - Consider using separate credentials with minimal scopes for CRM and project-management operations.
- Add automated tests covering malicious hosts, HTTP URLs, user-information components, redirects, and nonstandard ports.
- Disable or strictly validate cross-origin redirects so credentials cannot be forwarded to a different host.
