Red Hat Bugzilla – Bug 520210
CVE-2009-3611 backintime: makes all files world-readable in snapshot when removing it
Last modified: 2009-10-15 03:51:43 EDT
A Debian bug report  indicates that backintime chmods files to mode 0777 prior to removing them via removing a snapshot. What makes this worse is that if those files exist in subsequent snapshots, the permissions on those files is also mode 0777 which allows anyone to manipulate/delete the files in the backup.
Looking at this further, if I set the backintime backup directory to, say /srv/backups/$USER, and were to have multiple users on the system, each user would be able to see the other's backup files. Granted, permissions are mimicked from the source, so if a file is 0644 at the source, it will be in the backup as well. However, I think it might be prudent if /srv/backups/$USER was also owned $USER:$USER and mode 0700.
The file in question is common/snapshots.py which contains:
316 path = self.get_snapshot_path( snapshot_id )
317 cmd = "chmod -R a+rwx "%s"" % path
318 self._execute( cmd )
319 cmd = "rm -rfv "%s"" % path
320 self._execute( cmd )
I'm not sure what the logic behind chmoding those files in the first place is. Obviously the user had to have read-permissions to get the files into the backup in the first place so they should all be owned by the user, meaning chmodding the files is relatively useless. The debian report suggests changing the chmod call to a find call and just changing the mode of directories, but I'm not convinced that's even necessary if the directories are owned by the user to begin with.
There are also two places where this call is made:
% grep -r 'chmod -R a+rwx' *
common/snapshots.py: cmd = "chmod -R a+rwx "%s"" % path
common/snapshots.py: self._execute( "chmod -R a+rwx "%s"" % new_snapshot_path )
so the second invocation likely needs to be changed as well.
This would affect Fedora 10, Fedora 11, and rawhide.
Afaik I can close this with rawhide, right?
No, this should be closed ERRATA, but it should only be closed when the updates are pushed to stable (currently in testing). There are no references in the bug that it has been pushed to stable and iirc bodhi should be doing that when it is done. Please don't close this until the updates are actually pushed to stable.
backintime-0.9.26-3.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.
backintime-0.9.26-3.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.