Tainted flow: 'item' from os.environ.get (line 192, credential/environment) → urllib.request.urlopen (network output)
- Category
- Data Flow
- Confidence
- 97% confidence
- Finding
The reported environment-variable provenance is inaccurate: this URL comes from the image API response. Nevertheless, passing it directly to urlopen permits a malicious or compromised API to request internal network resources or read local files through file URLs, with the returned bytes subsequently written as an output image.
- Content
python if item.get("b64_json"): return base64.b64decode(item["b64_json"]) if item.get("url"): with urllib.request.urlopen(item["url"], timeout=180) as r: return r.read() raise RuntimeError(f"响应字段无法识别: {list(item.keys())}")
