weak file permission with default config/installation

Bug #1251447 reported by Hannes Koschier
256
This bug affects 1 person
Affects Status Importance Assigned to Milestone
automysqlbackup (Debian)
Fix Released
Unknown
automysqlbackup (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Hi,

after a standard installation of the automysqlbackup package the packages create the default folder for backups under
/var/lib/automysqlbackup/

with permission 755 - so everyone can read the dumps.

root@kvm11152:~# ls -la /var/lib/automysqlbackup/
insgesamt 8
drwxr-xr-x 2 root root 4096 Feb 15 2012 .
drwxr-xr-x 43 root root 4096 Nov 14 00:57 ..

Revision history for this message
Seth Arnold (seth-arnold) wrote :

Thanks for the report, I can confirm:

$ ls -lad / /var /var/lib /var/lib/automysqlbackup
drwxr-xr-x 24 root root 4096 Oct 29 18:23 /
drwxr-xr-x 13 root root 4096 Oct 29 18:24 /var
drwxr-xr-x 59 root root 4096 Nov 14 15:23 /var/lib
drwxr-xr-x 2 root root 4096 Feb 15 2012 /var/lib/automysqlbackup

automysqlbackup is in universe, thus it is community-supported. If you
are able, I suggest coordinating with upstream and posting a debdiff for
this issue. When a debdiff is available, members of the security team
will review it and publish the package. See the following link for more
information: https://wiki.ubuntu.com/SecurityTeam/UpdateProcedures

Thanks

Changed in automysqlbackup (Ubuntu):
status: New → Confirmed
information type: Private Security → Public Security
Revision history for this message
Seth Arnold (seth-arnold) wrote :
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

While the actual backup files do get chmoded to 700, there is a race there. Best is to restrict permissions on the directory.

Revision history for this message
Thomas Goirand (thomas-goirand) wrote :

Hi,
No, there's no race condition for backuped files, it's not chmod that is in use. I would consider this bug as very low priority, since it only allows someone with a shell access to list the databases at most.

Also, please note that there's no "upstream" but the Debian package maintainer (eg: me) since the Debian package has diverged from upstream and could be considered a fork.

I would be happy to accept any patch to fix this problem (as I wont have much time to work on it myself).

Cheers,

Thomas

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

The code does this:

# Database dump function
dbdump () {
 touch $2
 chmod 600 $2
...
  mysqldump --defaults-file=/etc/mysql/debian.cnf $NEWOPT $1 > $2

That looks like a chmod to me.
Isn't it possible for someone to obtain a file handle on $2 between the touch and the chmod?

Changed in automysqlbackup (Debian):
status: Unknown → New
Changed in automysqlbackup (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.