Tainted flow: 'req' from os.environ.get (line 124, credential/environment) → urllib.request.urlopen (network output)
Critical
- Category
- Data Flow
- Content
put_url = image_put_url_resp.get("data", {}).get("put_url") # put_url是临时上传地址,需要上传图片到put_url req = urllib.request.Request(put_url, data=image_content, method="PUT") with urllib.request.urlopen(req, context=_get_ssl_context()) as resp: status = resp.getcode() if status != 200: raise Exception(f"Failed to upload image to put_url, status: {status}")- Confidence
- 91% confidence
- Finding
- The code fetches a server-provided put_url and blindly uploads local image contents to it without validating the destination host or scheme. If the remote API is compromised, malicious, or returns an unexpected URL, local file contents selected by the user could be sent to an arbitrary external endpoint, creating a data exfiltration risk.
