Files left in the lobby
Watch it happen
Mallory picks up secret files left in the lobby, reads the directory listing, and sends unusual requests to a counter window that accepts them all.
Alice walks in and goes to the counter window. Mallory follows, and notices the staff left papers lying around the public lobby.
In bank terms and app terms
| In the bank | In your app |
|---|---|
Are you exposed?
Opening /.env,/.git/HEADor/backup.zipon your site returns real file contents instead of a 404 or 403.Your static folder shows a file list (“Index of /”) when you visit it. Your server answers TRACE or accepts PUT and DELETE on routes that should only read.
Keep secrets in your host’s environment settings, not in the deployed folder. Block dotfiles (except /.well-known) and backups from being served. Rotate any secret that was ever public.Disable directory listing and delete old backups and build leftovers from public folders. Allow only the HTTP methods each route needs, and turn off TRACE on your web server or proxy.
What it looks like in code
// GOOD: Block sensitive paths in middleware or hosting config
// vercel.json
{
"headers": [
{ "source": "/.env", "headers": [{ "key": "x-robots-tag", "value": "noindex" }] }
],
"rewrites": [
{ "source": "/.env", "destination": "/404" },
{ "source": "/.git/(.*)", "destination": "/404" }
]
}
Ask your AI tool to fix it
Paste this into Cursor, Claude, Lovable, Bolt or whatever you build with.
Check that nothing sensitive is served publicly: .env files, .git, backups, source maps with secrets. Make sure the public/static folder contains only intended assets, disable directory listing, and block dotfiles (except /.well-known) in the server config, and rotate any secret that was exposed. Add per-route HTTP method allowlists (return 405), disable TRACE, and make sure error responses do not contain stack traces. List the changes.Where this comes from
The facts, figures and fixes on this page were checked against these sources on 25 Oct 2026. They are linked so you can check for yourself.
- WSTG: Review Old Backup and Unreferenced Files for Sensitive InformationOWASPBackups and special paths like .git/ left in public folders expose sensitive data
- WSTG: HTTP MethodsOWASPPUT and DELETE can change data; TRACE echoes requests (cross-site tracing)
- A05:2021 Security MisconfigurationOWASPDirectory listing left on and stack traces in errors are common misconfigurations
- III. ConfigThe Twelve-Factor AppKeep secrets and credentials in the environment, not in the deployed code folder
- RFC 8615: Well-Known URIsIETF/.well-known/ is the standard path prefix, so it is the exception to blocking dotfiles
- 405 Method Not AllowedMDN Web DocsReturn 405 with an Allow header for methods a route doesn't support
Spot a mistake or something out of date? Report a correction · How these guides are made and checked
The free, open-source scanner checks for most of the problems in these guides.