Guides · ← All guides
Exposed Backup Files: .bak, .old and .zip Files Sitting in Your Web Root
Published: November 14, 2026 · Last reviewed: November 14, 2026 · 7 min read
Run a free BreachHunter assessment on your site →
Every backup file in a web root began as an act of care. Someone was about to change something risky and made a copy first — the professionalism is not in question. What failed is geography: the copy was made in place, in the one directory on the server whose entire job is giving files to strangers.
This guide walks the backup family in the scanner's table — archives, SQL dumps, config and .env variants — explains the server-behavior quirk that makes .bak files worse than the originals, and lays out the three-layer fix: remove, deny by pattern, and move the backup habit somewhere private by default.
Why backup files are worse than the files they copy
A config.php on a correctly configured server executes and reveals nothing. config.php.bak is served as a text download. A database behind authentication requires credentials; db.sql in the root requires a URL. The backup strips the protection the original enjoyed while keeping 100% of the content — the scanner's ratings encode exactly that: SQL dumps and backup archives at HIGH (8 points), .env backups at CRITICAL (10) because of what .env holds.
The names are not creative, which is the second problem. backup, site-backup, db, dump, old, copy, the site name plus .zip, dates appended — the union of “obvious” names is small enough to probe exhaustively, and both the scanner's DIR wordlist and its sensitive-path table do. “Nobody will guess that filename” fails against a list that was built from thousands of real guesses. Treat any backup in the root as published, because functionally it is.
Remove, deny, relocate: the three layers
Layer one is today's files: inventory the root for archives, dumps and editor backups (.bak, .old, .save, .zip, .tar.gz, .sql) and delete them — after rotating any credentials they contained, per the rule that exposure means assumption of copying. Layer two is the server deny rule for the patterns as a class, so tomorrow's in-place backup is unservable even while it exists: extensions and dotfiles denied at the web-server or CDN layer.
Layer three fixes the habit: backups go to private object storage or a backup service, triggered by the platform, retained on a schedule, and — the step everyone skips — restore-tested. The website keeps a runbook line instead of a file: where backups live and how to restore. Owners who implement only layer one re-fail this finding within a year; the finding is a workflow, and the workflow is what gets fixed.
Worked example: atlasmoving.example
Atlas Moving Co's site had been “backed up” before every redesign since 2021 — in place. The assessment's directory and sensitive-path phases between them reconstructed the whole archaeology:
Exposed backup files: atlasmoving.example /backup.zip -> 200 212 MB HIGH (-8) /site-old.zip -> 200 96 MB HIGH (-8) /db.sql -> 200 41 MB HIGH (-8) full database dump /config.php.bak -> 200 HIGH (-8)
The dumps contained the customer database — names, addresses, move dates (a burglar's calendar, as the owner put it) — so the response ran as an incident: files deleted, database credentials rotated, customers assessed for notification under the firm's obligations. The boring layers followed: extension deny rules at the server, real backups moved to private storage with a 35-day retention, and a note in the redesign checklist that made “backup in place” a fired-upon offense. Retest: every probed name 404.
The five actions to take
Clearing the backup family for good:
- Inventory the web root for .zip/.tar.gz/.sql/.bak/.old/.save files and anything named backup, dump or old — delete them all.
- Rotate every credential present in any exposed file, database passwords first.
- Add server rules denying backup extensions and dotfiles as a class, not name by name.
- Move backups to private storage with scheduled retention — and test a restore once.
- Re-scan and add the probe to your post-deploy checklist; redesigns and migrations are when these files are born.
Run a free BreachHunter assessment on your site →
Frequently asked questions
The backup is 200MB. Would anyone really download it?
Yes — bandwidth is cheap and the payoff is a complete site and database. Automated harvesters fetch first and examine later. File size is no protection; if anything, the biggest archives are the most complete prizes.
Is a password-protected zip in the root acceptable?
It is better and still wrong: the file's existence invites offline cracking at the attacker's leisure, and the passwords chosen for such archives are rarely strong. Private storage costs less than the risk meeting. Move it.
How do these files keep appearing if we deleted them?
Because the workflow that creates them survived: an admin backing up before an edit, a migration plugin writing to the root, a host panel's one-click backup. Layers two and three of the fix — deny rules and a real backup location — exist precisely for the recurrence.
What about backups in a subfolder like /old/?
Same exposure, plus the directory-listing risk if indexes are on. The scanner's directory discovery probes old, backup and similar names explicitly. A subfolder is not a hiding place; it is a label.
Does deleting the file end the incident?
Deletion ends future downloads. Anything the file contained — credentials especially — must be treated as copied: rotate. If the file held personal data, your notification obligations may apply; that assessment is part of the response, not an optional extra.
The deploy habit that stops this recurring
Deleting the file fixes the instance. The class returns because the process that created it is still running — a backup plugin writing into the web root, a developer zipping the site 'just for a minute', a host migration that copies everything including last year's archives. Fix the process and the finding stops regenerating.
Concretely: point backup tools at storage outside the web root, add the backup extensions (.bak, .old, .zip, .sql) to your deploy checklist as a pre-flight search, and keep the server-level deny rule as the safety net underneath. Three cheap habits, and the quarterly scan becomes a confirmation instead of a discovery.
Sources
Where this guide's claims come from, in citable form:
- OWASP Web Security Testing Guide (2021) — its test case for old backup and unreferenced files is this exact finding.
- CISA Known Exploited Vulnerabilities Catalog (2021–present) — why exposed source and data files get used, not just noticed.