Tainted flow: 'UPLOAD_FILE_URL' from os.getenv (line 19, credential/environment) → requests.post (network output)
- Category
- Data Flow
- Confidence
- 90% confidence
- Finding
This function uploads an arbitrary local file to a URL derived from environment configuration, and the code does not validate that the destination is an approved HTTPS PI endpoint. In a skill context, this is more dangerous because the feature is specifically designed to exfiltrate local document contents to an external service, so a misconfigured or attacker-influenced base URL could redirect sensitive files and API credentials off-platform.
- Content
python with open(file_path, "rb") as f: files = {"file": (file_name, f)} response = requests.post(UPLOAD_FILE_URL, data=data, files=files, timeout=30) if response.status_code != 200: print( f"[upload_file] request failed, status_code={response.status_code}, response_text={response.text}"
