Tainted flow: 'image_url' from os.getenv (line 49, credential/environment) → requests.get (network output)
Critical
- Category
- Data Flow
- Content
# Download image img_path = self.output_dir / f"image_{int(time.time())}.png" img_data = requests.get(image_url).content with open(img_path, 'wb') as f: f.write(img_data)- Confidence
- 86% confidence
- Finding
- The code downloads a URL returned by an external API without validating the scheme, host, or size of the response. If the upstream service is compromised or returns an unexpected URL, this can enable server-side request forgery behavior or retrieval of malicious/oversized content into local storage.
