home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / hoobie / net_rpm.txt < prev    next >
Encoding:
Text File  |  2001-11-06  |  1.4 KB  |  51 lines

  1.  
  2. Program:  rpm(8), the RedHat Package Manager
  3.  
  4. Version:  2.3.11 current (shipped with RedHat Linux 4.2)
  5.           older ones as well.
  6.  
  7. OS:       RedHat Linux specific.
  8.  
  9. Problem:  temporary files.
  10.  
  11. Impact:   can be exploited to overwrite arbitrary files
  12.           on the system.
  13.  
  14.   Adding fuel to the temp. file discussion, here is yet another problem
  15.  with temporary file checking.
  16.  
  17.   RPM (Redhat Package Manager) has many useful features.  One of these
  18.  features is to retrieve a file off of the net and install it all in
  19.  one step.  When RPM is used this way, the file RPM is retrieving is
  20.  temporarily stored in /var/tmp.  The file mask RPM uses is
  21.  rpm-ftp-$no-$pid.tmp whereas $no is the number of the package in the
  22.  queue (0,1,2,...).
  23.  
  24.    Unfortunatly, rpm does not properly check if the temporary file
  25.  already exists, and will follow symlinks.  As rpm is often ran by
  26.  root, it is then possible to overwrite any file on the system,
  27.  regardless of access permissions.
  28.  
  29.  Fix:
  30.  ----
  31.  
  32.  Apply the following temporary patch below to url.c in the rpm
  33.  source directory.  RedHat should soon come with the proper fix.
  34.  
  35.  196c196,201
  36. <     fd = creat(dest, 0600);
  37. ---
  38. > //    fd = creat(dest, 0600);
  39. >    if(-1==(fd=open(dest,O_CREAT|O_EXCL|O_RDWR,0600)))
  40. >      {
  41. >       perror(dest);
  42. >       exit(1);
  43. >      }
  44.  
  45.  
  46. ---------------------------
  47.          plaguez
  48.  dube0866@eurobretagne.fr
  49. http://plaguez.insomnia.org
  50.  
  51.