Tainted flow: 'filename' from input (line 640, user input) → open (file write)
Medium
- Category
- Data Flow
- Content
print_report(report) filename = output_path or f"{ticker}_analysis_{datetime.now().strftime('%Y%m%d')}.json" with open(filename, "w") as f: json.dump(report, f, indent=2) print(f"✅ Full report saved to {filename}")- Confidence
- 88% confidence
- Finding
- The output filename is derived from user-controlled CLI input (`--output`) and passed directly to `open(..., "w")`, allowing arbitrary file overwrite within the permissions of the running user. In a skill context, this can clobber shell configs, application files, or other sensitive local files if the caller supplies a crafted path.
