Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Exposed backup files (.zip, .sql, .bak): how to find and fix them

OPS-165High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

A backup file is a copy of your site files or database. It becomes exposed when it sits inside the folder your web server publishes (often public_html, www or htdocs) and the server hands it out like any other file.

Common causes: a backup plugin that writes to a public folder, a developer running a quick mysqldump or zipping the site before an update, an editor leaving config.php.bak or index.php.old behind, or a migration archive nobody deleted. Attackers and scanners try common names such as /backup.zip, /db.sql, /site.tar.gz and /wp-config.php.bak automatically.

How a forgotten backup becomes a leak
  1. Backup createdZip or SQL dump made before an update
  2. Saved in web rootFile sits in public_html and is never removed
  3. Found by scannerBots request common file names
  4. Data downloadedCustomers, passwords and keys are copied

The break is the moment the file is left in a public folder.

Why it costs you leads or sales

A database dump usually holds every lead and customer you have captured: names, emails, phone numbers and sometimes order history. A site archive can hold config files with database passwords and API keys. Once copied, that data can be used for spam, phishing against your customers, or to take over your site.

The business damage is indirect but serious: a data breach you may have to report under privacy law, a hacked site that gets flagged by browsers or search engines and loses traffic, ad accounts suspended for malware, and lost customer trust. Fixing it takes minutes; recovering from a leak takes weeks.

How to check if your site has it

Only test your own site. Request likely file names directly in the browser or with curl. A 200 response with a file download means the file is exposed. A 404 or 403 means it is not served.

Check common backup paths on your own domainbash
for p in backup.zip backup.sql db.sql database.sql site.zip www.zip public_html.zip backup.tar.gz wp-config.php.bak wp-config.php.old index.php.bak .env.bak; do
  code=$(curl -s -o /dev/null -w "%{http_code}" "https://example.com/$p")
  echo "$code  /$p"
done
Where to look on the server
  • List the web root for files ending in .zip, .sql, .bak, .old, .tar, .gz, .7z, .rar, .dump and ~
  • Check upload and plugin folders, for example wp-content/uploads and any backup plugin folder
  • Check for archives named after your domain or a date, such as example.com-2024.zip
  • Search Google with site:yourdomain.com ext:zip OR ext:sql OR ext:bak
  • Ask your developer and host whether any old copies or staging folders are still online
Find backup-type files in the web root over SSHbash
find /path/to/public_html -type f \( -name "*.zip" -o -name "*.sql" -o -name "*.bak" -o -name "*.old" -o -name "*.tar" -o -name "*.tar.gz" -o -name "*.gz" -o -name "*~" \) -ls

How to fix it

Remove and lock down exposed backups
  1. Download a safe copy, then delete the public file

    Move the backup to private storage you control, then delete it from the web root. Do not just rename it.

  2. Rotate secrets that were inside it

    Change the database password, admin passwords, API keys and salts found in the archive or dump.

  3. Block backup file types at the server

    Add a rule so these extensions are never served, even if one is uploaded by mistake. See the snippets below.

  4. Move future backups out of the web root

    Send them to a folder above the public directory, to private cloud storage, or to your host's backup tool.

  5. Re-test the URLs

    Request the old paths again and confirm they return 404 or 403.

Apache (.htaccess): deny backup file typeshtaccess
<FilesMatch "\.(bak|sql|zip|tar|gz|7z|rar|old|dump|swp)$|~$">
  Require all denied
</FilesMatch>
Nginx: deny backup file typesnginx
location ~* \.(bak|sql|zip|tar|gz|7z|rar|old|dump|swp)$ {
    deny all;
    return 404;
}

location ~ ~$ {
    deny all;
}
Platform-specific steps
  1. Clean the uploads and plugin folders

    Using your host's file manager or SFTP, check wp-content/uploads, wp-content and the folders of backup plugins. Delete leftover .zip, .sql and .bak files.

  2. Change the backup plugin destination

    In your backup plugin's settings, choose remote storage (such as a cloud drive) or a folder outside public_html instead of a local folder under wp-content.

  3. Add the server rule

    On Apache hosts, add the FilesMatch block to .htaccess. On Nginx hosts, ask your host to add the location block.

Backup handling before and after

Exposed

  • backup.zip sits in public_html
  • Anyone can download it with a URL
  • Database password and customer data inside

Locked down

  • Backups stored off-server or above the web root
  • Server rule returns 403 or 404 for backup extensions
  • Secrets rotated after the exposure

How to confirm it's fixed

Verify the fix
  1. Re-run the curl check

    Every path should now return 403 or 404, not 200.

  2. Test from outside your network

    Use a private browser window or a mobile connection so you are not logged in.

  3. Search Google again

    Try site:yourdomain.com ext:zip OR ext:sql OR ext:bak. If an old file is still indexed, request removal in Google Search Console under Removals.

  4. Check server logs

    Look for past 200 responses to those paths to learn how long the file was exposed.

How to prevent it happening again

Prevention habits
  • Never create backups inside the public folder, even briefly
  • Use a backup tool that writes to private or remote storage
  • Delete migration archives as soon as the move is verified
  • Keep the deny rule for backup extensions in your server config
  • Block or avoid editors that leave .bak, .swp or ~ files in the web root, and deploy from version control
  • Repeat the curl check after every migration or redesign
  • Limit who has SFTP or file manager access

How FunnelGuard handles this

FunnelGuard does not check for exposed backup files today. It is a possible future check. FunnelGuard is a synthetic monitoring service: a robot visitor runs your real customer journeys (lead forms, checkouts, booking and chat buttons) and checks each step, tracking hits and test-lead delivery. It does not scan your server for files.

What it does cover nearby: if a hack or a bad server change breaks a form, a checkout or your tracking, a journey check can fail and you get an alert with a screenshot and a likely cause. That is a symptom, not proof of an exposed backup.

You can try the free plan (1 site, 2 journeys, daily checks, no card) to monitor your funnels, and a free read-only website audit is available too.

Questions people ask

What are exposed backup files?

They are copies of your site or database, such as backup.zip, db.sql or config.php.bak, stored in a folder the web server publishes. Anyone who requests the right URL can download them. They often contain passwords, customer data and source code.

How do I find backup files left on my website?

Request common names like /backup.zip and /db.sql on your own domain and look for a 200 response. Also search the web root over SFTP or SSH for .zip, .sql, .bak and .old files, and try a Google search with site:yourdomain.com ext:sql OR ext:zip.

How do I stop people downloading .sql and .zip files from my server?

Delete the files, then add a server rule that denies those extensions. On Apache use a FilesMatch block in .htaccess; on Nginx use a location block with deny all. Better still, store backups outside the public folder.

Is a backup.zip in public_html dangerous?

Yes. Scanners request names like backup.zip automatically, so it can be found within hours. It may expose your database password, API keys and customer records.

Do I need to change passwords after removing an exposed backup?

Yes. You cannot tell whether someone downloaded the file, so assume they did. Rotate the database password, admin logins, API keys and any secrets stored in the archive.

Where should I store website backups safely?

Store them off the server, such as private cloud storage, or in a folder above the public web root with restricted permissions. Encrypt them if they contain personal data, and use your host's backup tool or a plugin set to remote storage.

Can Google index my exposed backup file?

It can if a link to the file exists somewhere, though many are found by direct scanning instead. If a file was indexed, delete it and use the Removals tool in Google Search Console.

Does FunnelGuard detect exposed backup files?

No. FunnelGuard does not check for this yet; it may be added in future. It monitors funnels such as forms, checkouts and tracking, so use the manual checks in this guide or a security scanner for backup files.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: site safety (Stage 26, daily): backup.zip / backup.sql / dump.sql (verified sites).

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.