File served from 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
res.sendFile / res.download is given a path taken from req.query/params/body/path/url, so ../ sequences let an attacker read files outside the intended directory.
Why it matters
Passing a request-controlled value to res.sendFile or res.download lets a caller send ../ sequences (or an absolute path) to escape the intended directory and read arbitrary files, including source, config, and .env. Path traversal through file-serving endpoints is a common and high-impact bug. The user input decides which file leaves your server.
How to fix it
Never build the served path directly from request input. Resolve the requested name against a fixed base directory and confirm the result still lives inside it (path.resolve then a startsWith check), or better, map an opaque id to a known file. Use the sendFile root option and reject names containing path separators or ...
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