Backup or Temporary Files Exposed
Backup, temporary or archive copies of files are left in web-accessible locations, where they can be downloaded and may reveal source code, credentials or data.
| Severity | Medium |
| CVSS 3.1 | 5.3 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N Open in the calculator |
| CVSS 4.0 | 6.9 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-530: Exposure of Backup File to an Unauthorized Control Sphere |
| MITRE ATT&CK | T1594 Search Victim-Owned Websites, T1552.001 Credentials In Files |
| Category | Information Disclosure |
Description
Copies of files have been left in directories that the web server serves: editor backups and swap files (index.php~, .index.php.swp), copies made by hand before a change (config.php.bak, web.config.old, login.aspx.orig), archives of the site or its database (backup.zip, site.tar.gz, dump.sql), and temporary or log files. They usually arise from editing directly on the server, from manual backups taken before an update, and from archives created during migrations and never removed.
Because the server does not recognise these extensions as code to run, it returns their raw contents: a request for config.php runs the script and returns nothing of interest, whereas config.php.bak returns its source, including any credentials it holds. Once their names are found, anyone can download the files without authentication. Source code reveals the application's logic, hidden functions and further weaknesses; configuration copies often contain database passwords, API keys and other secrets; and database dumps can expose personal data and password hashes. The impact depends on the content: copies of static files matter little, while a configuration file or database backup can lead directly to a wider compromise.
Such files are found with content discovery tools such as ffuf, Gobuster and dirsearch, using wordlists and permutations of known file names with backup extensions, and through directory listings and references in pages. Web server scanners such as Nikto report common names.
Remediation
Remove the files, then stop new ones reaching web-accessible locations:
- Delete backup, temporary and archive files from the web root, and keep backups on separate storage outside it, with its own access control.
- Deploy from a clean build artefact through an automated process that replaces the whole application directory, rather than editing files on the server, so that stray files are not carried forward.
- Block requests for backup and temporary file patterns at the web server as defence in depth, adjusting the list to what the site legitimately serves. On IIS, request filtering can deny the same file name extensions.
- Rotate any credentials or keys found in the exposed files, and review access logs for earlier downloads of them.
Confirm the fix by repeating content discovery against the site and requesting the files previously found: each should return 404 or 403.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.