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 builds a PATCH target from the environment-controlled OPENCLAW_GATEWAY_URL and sends a payload containing the API key, optionally with a bearer token. If that environment variable is influenced by an attacker or misconfigured, the secret can be exfiltrated to an unintended host, and the default plain HTTP transport further increases exposure risk.
