Tainted flow: 'req' from os.environ.get (line 13, credential/environment) → urllib.request.urlopen (network output)
Critical
- Category
- Data Flow
- Content
url = BASE + path if params: url += "?" + "&".join(f"{k}={v}" for k, v in params.items()) req = urllib.request.Request(url, headers={"x-api-key": KEY}) with urllib.request.urlopen(req, timeout=20) as r: return json.loads(r.read().decode()) @mcp.tool()- Confidence
- 88% confidence
- Finding
- The request URL is derived from the X402_BASE environment variable and then used directly in urllib.request.urlopen, so whoever controls the runtime environment can redirect this tool's outbound request to an arbitrary host. Because the code also attaches the x-api-key header to every request, a misconfigured or attacker-controlled BASE can cause credential disclosure or SSRF-like behavior from the MCP server process.
