Tainted flow: 'gateway_url' from os.environ.get (line 33, credential/environment) → requests.patch (network output)
Critical
- Category
- Data Flow
- Content
headers = {} if token: headers["Authorization"] = f"Bearer {token}" resp = requests.patch(f"{gateway_url}/api/config", headers=headers, json=payload, timeout=5) return resp.ok except Exception:- Confidence
- 94% confidence
- Finding
- The code sends the API key payload and optional bearer token to a URL taken directly from the OPENCLAW_GATEWAY_URL environment variable, with no validation of scheme, host, or trust boundary. If that environment variable is influenced by an attacker or misconfigured, credentials can be exfiltrated to an arbitrary remote server; the default of plain HTTP also weakens transport security.
