RE: gzip TOCTOU file-permissions vulnerability

From: Mark Senior (Mark.Senior_at_gov.ab.ca)
Date: 04/14/05

  • Next message: Hyperdose Security: "Trojan file issue in Musicmatch software"
    Date: Thu, 14 Apr 2005 09:27:11 -0600
    To: "Derek Martin" <code@pizzashack.org>, <bugtraq@securityfocus.com>
    
    

     

    > From: Derek Martin [mailto:code@pizzashack.org]
    > Sent: April 13, 2005 08:50
    >
    >
    > The open() call is at fault here. If instead of being called
    > with a mode of RW_USER, it is called with the final intended
    > access mode, there is no need to later call chmod(), and the
    > problem is averted.

    One wrinkle - if the file is not intended to have user write permission
    on it, and gzip (unzip/cpio/pax...) initially created it with the
    intended permissions, there would be no way to then write the file.

    The problem, to my understanding, is that the program opens the file by
    name, then closes it, and then chmod's it, again referring to it by
    name. During which time, as you pointed out, we could be dealing with a
    different inode.

    If the program kept the file open, and used fchmod to change its
    permissions, referring to it by file descriptor, you could be more sure
    that it was the same inode it had just been writing to.

    Cheers
    Mark

    --- end of meaningful content, legal bumph follows ---

    This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.

    This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.


  • Next message: Hyperdose Security: "Trojan file issue in Musicmatch software"

    Relevant Pages

    • Re: Username and Usergroup
      ... > group that has the permissions to run the query in question, ... who opens which forms. ... "Approved" field) and another one for members of the "Supervisors" group ... queries that are nearly identical, one for each group, a single query can be ...
      (microsoft.public.access.formscoding)
    • Re: Probs accessing database for users of newly developed Superuse
      ... but the SuperUsers cannot get into it. ... You've double-checked their permissions and all are correct. ... I've included the code for when the form opens below. ... ' Minimize the database window and initialize the form. ...
      (microsoft.public.access.security)
    • Re: Office Docs wont Open? and BU Drive not Recognized?
      ... Create a new Folder: ... On the server share... ... SHARING tab | Permissions | Share Permissions | Group or User Names ... If I copy the document to the local Client, the document opens ...
      (microsoft.public.windows.server.sbs)
    • Re: Please Help - I have networked my laptop to my pc and can only
      ... That leaves us with the first problem, which is permissions related. ... and sneaker-net them over to the laptop for editing. ... Walk through the wizard. ... it only opens in read-only and will not let me make ...
      (microsoft.public.windowsxp.security_admin)
    • Re: Adding new users to an Access 2002 DB
      ... So the mdb opens when you are using the standard system.mdw. ... It sounds like someone didn't secure it properly, ... When you open it, go to Tools, Security, permissions and check to see what ...
      (microsoft.public.access.security)