Will It Vibe logoWill It Vibe?
FLASK-011High severity-15 points

File served from a request-controlled path

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

send_file() or send_from_directory() is given a path built directly from request.args/form/values/json/data, so a traversal payload such as ../../../../etc/passwd controls which file on disk gets returned to the client.

Why it matters

send_file() and send_from_directory() return the contents of whatever path they are given. When that path is built directly from request.args/form/values/json/data, a value like '../../../../etc/passwd' or an absolute path to a config file lets the caller read any file the server process can access, including source code, credentials, and other users' uploaded data.

How to fix it

Never pass a request value straight into send_file()/send_from_directory(). Validate it against an allow-list of known filenames or IDs, or resolve the requested path against a fixed base directory and confirm with os.path.realpath()/Path.resolve() plus a prefix check (or Path.is_relative_to() on Python 3.9+) that the result still lives inside that directory before serving it.

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

Related Security checks