Uploaded file saved without secure_filename()
Part of Security, which counts for 30% of the overall score. When this check fires it deducts 15 points from that category, once per scan, no matter how many places it turns up.
What it detects
An uploaded file (request.files[...]) is saved with file.save(...) using its own .filename directly, with no werkzeug.utils.secure_filename() call nearby. A filename like '../../app.py' or an absolute path lets the upload overwrite files outside the intended directory.
Why it matters
A file uploaded through request.files carries a filename the client fully controls. Saving it with file.save(...) using that filename as-is means a value like '../../app.py' or an absolute path can write outside the intended upload folder, overwriting application code or planting a file somewhere the server will later execute or serve. This is one of the most common real-world Flask upload vulnerabilities, precisely because the fix (secure_filename) is one import away and easy to forget.
How to fix it
Import secure_filename from werkzeug.utils and wrap the filename before using it in any path: filename = secure_filename(file.filename); file.save(os.path.join(UPLOAD_DIR, filename)). Also validate the extension against an allow-list and consider generating a server-side random filename instead of trusting the client's name at all.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo