Tainted flow: 'filepath' from requests.post (line 363, network input) → open (file write)
Medium
- Category
- Data Flow
- Content
response = requests.get(url, timeout=30) response.raise_for_status() with open(filepath, 'wb') as f: f.write(response.content) return (True, filepath) except Exception as e:- Confidence
- 88% confidence
- Finding
- The code downloads content from a remote URL and writes it to a caller-controlled filepath via --save without path restriction or validation. In an agent context, this can overwrite arbitrary files writable by the current user, and the URL source is also remote-controlled, making it a file-write primitive beyond the advertised image-generation behavior.
