Tainted flow: 'dest_path' from os.getenv (line 101, credential/environment) → open (file write)
Medium
- Category
- Data Flow
- Content
dest_path = MEDIA_ROOT / filename try: with open(dest_path, 'wb') as f: # Read in chunks to handle large files while True: chunk = file_item.file.read(8192)- Confidence
- 92% confidence
- Finding
- The server writes attacker-supplied upload content directly to disk in a directory controlled by an environment variable, with no authentication, size limits, or validation of what may be stored. Although the filename is basename-normalized, any host on the LAN can still create or overwrite files in MEDIA_ROOT, which can lead to disk exhaustion, poisoning of shared content, or unsafe placement if UPLOAD_ROOT is configured to a sensitive location.
