Tainted flow: 'img_url' from requests.get (line 118, network input) → requests.get (network output)
Medium
- Category
- Data Flow
- Content
if data and len(data) > 0: img_url = data[0].get('url', '') if img_url: img_resp = requests.get(img_url, timeout=15) if img_resp.status_code == 200 and len(img_resp.content) > 5000: img_path = os.path.join(self.img_dir, f'cat_{int(time.time())}.jpg') with open(img_path, 'wb') as f:- Confidence
- 93% confidence
- Finding
- The code takes an image URL returned by a third-party API and immediately performs a second request to that URL without validating the scheme, host, or address range. If the upstream API is compromised or malicious, this can be abused as SSRF to make the host contact arbitrary internal or external endpoints, which is more concerning in an agent skill that may run with network access and trusted credentials.
