The security team cleared this issue to be fixed publicly.

If a custom destination backup path is set, the module's access-check uses the default path to compute the http request. Presumable, the requested path won't exist. So the check does not verify the access denial that should be caused by the created .htaccess file.
If the webserver ignored the .htaccess and an attacker knew the path, he could download the file.

Steps to reproduce:
in Drupal Administration:
- Administer -> Content management -> Backup and Migrate
- on tab "destinations":
- Manual Backups Directory - edit
- set to "sites/test/files/backup_migrate/manual", Save destination (note: maybe you have to create this path and give the webserver write access)
- on tab "backup":
- ensure Quick Backup to Manual Backups Directory
- click "Backup now"

gives the following apache error-log entry:
"File does not exist: /var/www/<host>/sites/default/files/ckup_migrate"
(Note: the missing "ba" in backup_migrate gives a hint.)

The module tries to check if http access to the backup directory is blocked, but uses the wrong (default) path instead of the custom (manual) backup directory path.

I believe the problem is in the file "backup_migrate/includes/destinations.file.inc":
- function check_web_dir($directory)
- function test_file_readable_remotely($path, $contents)
make use of file_directory_path() instead of using the custom backup directory path.

Comments

onewomanbiz’s picture

Version: 6.x-2.2 » 7.x-2.4

I would like to confirm custom destination path is ignored. As per instructions, a protected file directory is set up. However upon execution of backup to server, an error says destination folder not secure, and, file path does not exist. On checking manual backup destination path, there is an arbitrary default path is private // backup_migrate/manual.

This path must be modified through "override" button and manually set to path of protected file. After that Backup completes successfully.

This is not very intuitive or clear to user.

ronan’s picture

Status: Active » Fixed

Ok, this was fairly simple to fix. The access check should now work for all paths within the web root whether they've been specifed relative to the site root or with absolute paths.

Status: Fixed » Closed (fixed)
Issue tags: -Security improvements

Automatically closed -- issue fixed for 2 weeks with no activity.