Tainted flow: 'gateway_url' from os.environ.get (line 32, 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 takes OPENCLAW_GATEWAY_URL directly from the environment and sends the API key payload to that URL without validating the scheme, host, or trust boundary. If an attacker can influence the environment or runtime configuration, they can redirect credential-bearing requests to an attacker-controlled endpoint, causing secret exfiltration.
