home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / general / cert0047.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  6.8 KB  |  164 lines

  1.  
  2. -----BEGIN PGP SIGNED MESSAGE-----
  3.  
  4. ===========================================================================
  5. CA-92:11                        CERT Advisory
  6.                                 May 27, 1992
  7.              SunOS Environment Variables and setuid/setgid Vulnerability
  8. - ---------------------------------------------------------------------------
  9.  
  10. The Computer Emergency Response Team/Coordination Center (CERT/CC) has
  11. received information concerning a vulnerability involving environment
  12. variables and setuid/setgid programs under Sun Microsystems Computer
  13. Corporation SunOS.  This vulnerability exists on all Sun architectures
  14. running SunOS 4.0 and higher.
  15.  
  16. In-house and third-party software can also be impacted by this
  17. vulnerability.  For example, the current versions of rnews, sudo,
  18. smount, and npasswd are known to be vulnerable under SunOS.  See the
  19. Description section of this advisory for details of how to identify
  20. software which may be vulnerable.
  21.  
  22. The workaround detailed in this advisory can be used to protect
  23. vulnerable software on SunOS operating system versions for which
  24. patches are unavailable, or for local or third party software which
  25. may be vulnerable.
  26.  
  27. Sun has provided patches for SunOS 4.1, 4.1.1, and 4.1.2 programs
  28. which are known to be impacted by this vulnerability.  They are
  29. available through your local Sun Answer Center as well as through
  30. anonymous ftp from the ftp.uu.net (137.39.1.9) system in the
  31. /systems/sun/sun-dist directory.
  32.  
  33. Fix                     PatchID        Filename            Checksum
  34. login and su            100630-01      100630-01.tar.Z     36269    39
  35. sendmail                100377-04      100377-04.tar.Z     14692   311
  36.  
  37. Note: PatchID 100630-01 contains the international version of
  38. /usr/bin/login.  PatchID 100631-01 contains the domestic version
  39. of /usr/bin/login and is only available from Sun Answer Centers for
  40. sites that use the US Encryption Kit.
  41.  
  42. Please note that Sun will occasionally update patch files.  If you
  43. find that the checksum is different please contact Sun or the CERT/CC
  44. for verification.
  45.  
  46. - ---------------------------------------------------------------------------
  47.  
  48. I.   Description
  49.  
  50.      A security vulnerability exists if a set-user-id program changes
  51.      its real and effective user ids to be the same (but not to the
  52.      invoker's id), and subsequently causes a dynamically-linked program 
  53.      to be exec'd.  A similar vulnerability exists for set-group-id programs.
  54.  
  55.      In particular, SunOS /usr/lib/sendmail, /usr/bin/login,
  56.      /usr/bin/su, and /usr/5bin/su are vulnerable to this problem.
  57.  
  58. II.  Impact
  59.  
  60.      Local users can gain unauthorized privileged access to the system.
  61.  
  62. III. Solution
  63.         
  64.      A.  Obtain and install the patches from Sun or from ftp.uu.net following 
  65.          the provided instructions.
  66.  
  67.      B.  The following workaround can be used to protect vulnerable binaries
  68.          for which patches are unavailable for your SunOS version,
  69.          or for local or third party software which may be vulnerable. 
  70.          The example given is a workaround for /usr/lib/sendmail.  
  71.  
  72.          1.  As root, rename the existing version of /usr/lib/sendmail
  73.              and modify the permissions to prevent misuse.
  74.  
  75.              # mv /usr/lib/sendmail /usr/lib/sendmail.dist
  76.              # chmod 755 /usr/lib/sendmail.dist
  77.  
  78.          2.  In an empty temporary directory, create a file wrapper.c
  79.              containing the following C program source (remember to
  80.              strip any leading white-space characters from the #define lines).
  81.  
  82.              /* Start of C program source */
  83.  
  84.              /* Change the next line to reflect the full pathname
  85.                 of the file to be protected by the wrapper code   */
  86.  
  87.              #define COMMAND "/usr/lib/sendmail.dist"
  88.              #define VAR_NAME "LD_"
  89.  
  90.              main(argc,argv,envp)
  91.              int argc;
  92.              char **argv;
  93.              char **envp;
  94.              {
  95.                      register char  **cpp;
  96.                      register char  **xpp;
  97.                      register char   *cp;
  98.  
  99.                      for (cpp = envp; cp = *cpp;) {
  100.                              if (strncmp(cp, VAR_NAME, strlen(VAR_NAME))==0) {
  101.                                      for (xpp = cpp; xpp[0] = xpp[1]; xpp++);
  102.                                      /* void */ ;
  103.                              }
  104.                              else {
  105.                                      cpp++;
  106.                              }
  107.                      }
  108.  
  109.                      execv(COMMAND, argv);
  110.                      perror(COMMAND);
  111.                      exit(1);
  112.              }
  113.              /* End of C program source */
  114.  
  115.          3.  As root, compile the C program source for the wrapper and
  116.              install the resulting binary.
  117.  
  118.              # make wrapper
  119.              # mv ./wrapper /usr/lib/sendmail
  120.              # chown root /usr/lib/sendmail
  121.              # chmod 4711 /usr/lib/sendmail
  122.  
  123.          4.  Steps 1 through 3 should be repeated for other vulnerable
  124.              programs with the appropriate substitution of pathnames and file
  125.              names. The "COMMAND" C preprocessor variable within the C program
  126.              source should also be changed to reflect the appropriate renamed
  127.              system binary.
  128.  
  129. - ---------------------------------------------------------------------------
  130. The CERT/CC wishes to thank the following for their assistance: CIAC,
  131. PCERT, and in particular Wietse Venema of Eindhoven University, The
  132. Netherlands, for his support in the analysis of and a workaround for
  133. this problem.  We also wish to thank Sun Microsystems Computer
  134. Corporation for their prompt response to this vulnerability.
  135. - ---------------------------------------------------------------------------
  136.  
  137. If you believe that your system has been compromised, contact CERT/CC or
  138. your representative in FIRST (Forum of Incident Response and Security Teams).
  139.  
  140. Internet E-mail: cert@cert.org
  141. Telephone: 412-268-7090 (24-hour hotline)
  142.            CERT/CC personnel answer 7:30 a.m.-6:00 p.m. EST(GMT-5)/EDT(GMT-4),
  143.            on call for emergencies during other hours.
  144.  
  145. Computer Emergency Response Team/Coordination Center (CERT/CC)
  146. Software Engineering Institute
  147. Carnegie Mellon University
  148. Pittsburgh, PA 15213-3890
  149.  
  150. Past advisories, information about FIRST representatives, and other
  151. information related to computer security are available for anonymous ftp
  152. from cert.org (192.88.209.5).
  153.  
  154. -----BEGIN PGP SIGNATURE-----
  155. Version: 2.6.2
  156.  
  157. iQCVAwUBMaMw+3VP+x0t4w7BAQH2nQP/cNn2C4eEpq4RlBYP7vBHCq6RZ7UQ2PhY
  158. wbnOYLRvtQrN1bbn367W+ZKCaMQjdTJnIT+e8DwgEjpG3gh689eJ/P5Bg8+POKCO
  159. QfI3qEmfTCAnYiEGKSJ+eaqbobF1CueeFnr3pIlU/ke9oW7zC0Iq29fLrBS2p83p
  160. ioCjmoPmG4I=
  161. =q0YU
  162. -----END PGP SIGNATURE-----
  163.  
  164.