First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 93792
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Security <security@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Romang <zataz@zataz.net>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:
Flags: Requestee:
 
 
  ()

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 93792 depends on: Show dependency tree
Bug 93792 blocks:

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-05-24 04:27 0000
Hello,

During the drop off a database, xmysqladmin dropt the database and create a tar.gz inside /tmp without checking if the file exist already.

void dropdb_drop(FL_OBJECT *obj, long data)
{
  char *cmd;

  if(!fl_show_question("WARNING!!!\nThis database will be delete.\nDo you want to continue?", 0))
        return;
  if(!fl_show_question("WARNING!!!\nThis database will be delete.\nAre you sure?", 0))
        return;

  cmd = (char *) malloc(2048);
  if(!cmd) return;

  sprintf(cmd, "%s %s/%s.tar%s %s%s/*", BACKUP, BACKUPDIR, g_dropdb_dbfname,
          BACKUPSUFFIX, Setup.datapath, g_dropdb_dbfname);

  fl_show_command_log(FL_TRANSIENT);
  fl_exe_command(cmd, 1);
  free(cmd);

  {
    MYSQL connection;
    if(g_mysql_connect(&connection, Setup.host, Setup.user, Setup.password))
    {
      if(mysql_drop_db(&connection, g_dropdb_dbfname))
        {
          fl_show_alert(mysql_error(&connection),"","",0);
        }
      else
        {
          fl_show_message("The database",g_dropdb_dbfname,"has been destroyed");
        }

      mysql_close(&connection);
    }
    else
      {
          fl_show_alert("Cannot connect to server","","",0);
      }
  }

Possible to overwrite arbitrary files or get the content off the database.

Maybe more bugs into this soft ;)

Regards.

------- Comment #1 From Tavis Ormandy (RETIRED) 2005-05-29 01:15:51 0000 -------
Yes, perhaps BACKUPDIR could be set to "." in the Makefile?

------- Comment #2 From Romang 2005-05-29 07:51:27 0000 -------
Hello,

Yes it's a solution. If the . directory is not world writable.
Upstream should find another solution.

I contact him, and propose him the . solution.

Regards.

------- Comment #3 From Romang 2005-06-06 01:22:34 0000 -------
Hello,

No upstream response.

Regards.

------- Comment #4 From Tavis Ormandy (RETIRED) 2005-06-09 09:37:39 0000 -------
*** Bug 95571 has been marked as a duplicate of this bug. ***

------- Comment #5 From Tavis Ormandy (RETIRED) 2005-06-09 09:38:17 0000 -------
public

------- Comment #6 From Thierry Carrez (RETIRED) 2005-06-24 05:56:43 0000 -------
So we need to patch the Makefile (or remove the package) since upstream is
silent.

No maintainer...
mysql herd, do you feel like taking this one ?
rphillips: you're the only survivor in the old committers, let us know if you
accept to patch again.

I guess we'll have to mask/remove it if noone wants it.

------- Comment #7 From Francesco R. (RETIRED) 2005-06-27 01:38:27 0000 -------
Koon: can you hard mask it in my place please ?
Waiting approval from herd lead to remove it.

------- Comment #8 From Thierry Carrez (RETIRED) 2005-06-27 01:57:39 0000 -------
Package masked on vivo's request. Bug kept open until complete removal.

------- Comment #9 From Robin Johnson 2005-08-17 17:25:59 0000 -------
I don't agree that this is insecure temp file creation.
the permissions of the created file in /tmp are 644.

sure the design decision of creating /tmp/foo.tar.gz without checkign that it
already exists isn't great, but it's not bad given that xmysqladmin is run with
user permissions. it fails if the user doesn't have permissions to write there,
provided your /tmp is set up correctly with the sticky bit.

It looks like it should be acceptable to set umask(0077) before running tar.

------- Comment #10 From Sune Kloppenborg Jeppesen 2006-03-22 12:41:27 0000 -------
Any news on this one?

------- Comment #11 From Luca Longinotti 2006-04-16 13:09:15 0000 -------
MySQL herd doesn't really want to maintain this, since it's p.masked since a
long time, I'd go for removal.
If none speaks up, I'll send the last rites email tomorrow, and remove from the
tree two weeks after that.
Best regards, CHTEKK.

------- Comment #12 From Luca Longinotti 2006-08-26 15:43:55 0000 -------
Removed from Portage.
Best regards, CHTEKK.

First Last Prev Next    No search results available      Search page      Enter new bug