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

  1.  
  2. -----BEGIN PGP SIGNED MESSAGE-----
  3.  
  4. =============================================================================
  5. CERT* Advisory CA-97.02
  6. Original issue date: January 7, 1997
  7. Last revised: April 3, 1997 
  8.               Updates section - Added a note that the vulnerability is being
  9.                                 exploited. 
  10.  
  11. Topic: HP-UX newgrp Buffer Overrun Vulnerability
  12. - -----------------------------------------------------------------------------
  13.  
  14.    The text of this advisory was originally released on December 3, 1996, as
  15.    AA-96.16.HP-UX.newgrp.Buffer.Overrun.Vulnerability, developed by
  16.    AUSCERT. Because of the seriousness of the problem, we are reprinting the
  17.    AUSCERT advisory here with their permission. Only the contact information
  18.    at the end has changed: AUSCERT contact information has been replaced with
  19.    CERT/CC contact information.
  20.  
  21.    We will update this advisory as we receive additional information.
  22.    Look for it in an "Updates" section at the end of the advisory.
  23.  
  24. ===========================================================================
  25.  
  26. AUSCERT has received information that a vulnerability exists in the
  27. newgrp(1) program under HP-UX 9.x and 10.x.
  28.  
  29. This vulnerability may allow local users to gain root privileges.
  30.  
  31. Exploit information involving this vulnerability has been made publicly
  32. available.
  33.  
  34. Currently there are no vendor patches available that address this
  35. vulnerability.  AUSCERT recommends that sites take the steps outlined in
  36. section 3 as soon as possible.
  37.  
  38. This advisory will be updated as more information becomes available.
  39. - ----------------------------------------------------------------------------
  40.  
  41. 1.  Description
  42.  
  43.     AUSCERT has received information that a vulnerability exists in the
  44.     HP-UX newgrp(1) program.  The newgrp command is used to change a users
  45.     group identification, and is installed by default.
  46.  
  47.     Due to insufficient bounds checking on arguments which are supplied
  48.     by users, it is possible to overwrite the internal stack space of the
  49.     newgrp program while it is executing.  By supplying a carefully
  50.     designed argument to the newgrp program, intruders may be able to
  51.     force newgrp to execute arbitrary commands.  As newgrp is setuid
  52.     root, this may allow intruders to run arbitrary commands with root
  53.     privileges.
  54.  
  55.     This vulnerability is known to affect both HP-UX 9.x and 10.x.
  56.  
  57.     By default, newgrp is located in /bin under HP-UX 9.x and in
  58.     /usr/bin under HP-UX 10.x.
  59.  
  60.     Exploit information involving this vulnerability has been made
  61.     publicly available.
  62.  
  63. 2.  Impact
  64.  
  65.     Local users may gain root privileges.
  66.  
  67. 3.  Workarounds/Solution
  68.  
  69.     AUSCERT recommends that sites limit the possible exploitation of this
  70.     vulnerability by immediately removing the setuid permissions as stated
  71.     in Section 3.1.  If the newgrp command is required, AUSCERT recommends
  72.     the newgrp wrapper program given in Section 3.2 be installed.
  73.  
  74.     AUSCERT recommends that official vendor patches be installed when
  75.     they are made available.  See the Updates section for information
  76.     about availability of patches.
  77.  
  78. 3.1 Remove setuid and non-root execute permissions
  79.  
  80.     To prevent the exploitation of the vulnerability described in the
  81.     advisory, AUSCERT recommends that the setuid permissions be removed from
  82.     the newgrp program immediately.  As the newgrp program will no
  83.     longer work for non-root users, it is recommended that the execute
  84.     permissions also be removed.  Before doing so, the original permissions
  85.     for newgrp should be noted as they will be needed if sites choose to
  86.     install the newgrp wrapper program (Section 3.2).
  87.  
  88.     For HP-UX 9.x:
  89.  
  90.         # ls -l /bin/newgrp
  91.         -r-sr-xr-x   1 root     sys        16384 Dec  2 13:45 /bin/newgrp
  92.  
  93.         # chmod 500 /bin/newgrp
  94.         # ls -l /bin/newgrp
  95.         -r-x------   1 root     sys        16384 Dec  2 13:45 /bin/newgrp
  96.  
  97.     For HP-UX 10.x:
  98.  
  99.         # ls -l /usr/bin/newgrp
  100.         -r-sr-xr-x   1 root     sys        12288 Dec  2 13:27 /usr/bin/newgrp
  101.  
  102.         # chmod 500 /usr/bin/newgrp
  103.         # ls -l /usr/bin/newgrp
  104.         -r-x------   1 root     sys        12288 Dec  2 13:27 /usr/bin/newgrp
  105.  
  106.     Note that this will remove the ability for any non-root user to run the
  107.     newgrp program.
  108.  
  109. 3.2 Install newgrp wrapper
  110.  
  111.     AUSCERT has developed a wrapper to help prevent programs from being
  112.     exploited using the vulnerability described in this advisory.  This
  113.     wrapper, including installation instructions, can be found at:
  114.  
  115.         ftp://ftp.auscert.org.au/pub/auscert/tools/overflow_wrapper.c
  116.  
  117.     This replaces the newgrp program with a wrapper which checks the
  118.     length of the command line arguments passed to it.  If an argument
  119.     exceeds a certain predefined value (MAXARGLEN), the wrapper exits
  120.     without executing the newgrp command.  The wrapper program can also
  121.     be configured to syslog any failed attempts to execute newgrp with
  122.     arguments exceeding MAXARGLEN.  For further instructions on using
  123.     this wrapper, please read the comments at the top of overflow_wrapper.c.
  124.  
  125.     When compiling overflow_wrapper.c for use with HP-UX newgrp, AUSCERT
  126.     recommends defining MAXARGLEN to be 16.
  127.  
  128.     The MD5 checksum for Version 1.0 of overflow_wrapper.c is:
  129.  
  130.         MD5 (overflow_wrapper.c) = f7f83af7f3f0ec1188ed26cf9280f6db
  131.  
  132.     AUSCERT recommends that until vendor patches can be installed, sites
  133.     requiring the newgrp functionality apply this workaround.
  134.  
  135. - ----------------------------------------------------------------------------
  136. AUSCERT thanks Hewlett-Packard for their continued assistance and technical
  137. expertise essential for the production of this advisory.  AUSCERT also
  138. thanks Information Technology Services of the University of Southern
  139. Queensland for their assistance.
  140. - ----------------------------------------------------------------------------
  141.  
  142. If you believe that your system has been compromised, contact the CERT
  143. Coordination Center or your representative in the Forum of Incident
  144. Response and Security Teams (FIRST).
  145.  
  146. We strongly urge you to encrypt any sensitive information you send by email.
  147. The CERT Coordination Center can support a shared DES key and PGP. Contact
  148. the CERT staff for more information.
  149.  
  150. Location of CERT PGP key
  151.          ftp://info.cert.org/pub/CERT_PGP.key
  152.  
  153. CERT Contact Information
  154. - ------------------------
  155. Email    cert@cert.org
  156.  
  157. Phone    +1 412-268-7090 (24-hour hotline)
  158.                 CERT personnel answer 8:30-5:00 p.m. EST
  159.                 (GMT-5)/EDT(GMT-4), and are on call for
  160.                 emergencies during other hours.
  161.  
  162. Fax      +1 412-268-6989
  163.  
  164. Postal address
  165.         CERT Coordination Center
  166.         Software Engineering Institute
  167.         Carnegie Mellon University
  168.         Pittsburgh PA 15213-3890
  169.         USA
  170.  
  171. CERT publications, information about FIRST representatives, and other
  172. security-related information are available for anonymous FTP from
  173.         http://www.cert.org/
  174.         ftp://info.cert.org/pub/
  175.  
  176. CERT advisories and bulletins are also posted on the USENET newsgroup
  177.         comp.security.announce
  178.  
  179. To be added to our mailing list for CERT advisories and bulletins, send your
  180. email address to
  181.         cert-advisory-request@cert.org
  182.  
  183.  
  184. * Registered U.S. Patent and Trademark Office.
  185.  
  186. This file: ftp://info.cert.org/pub/cert_advisories/CA-97.02.hp_newgrp
  187.            http://www.cert.org
  188.                click on "CERT Advisories"
  189.  
  190. =============================================================================
  191. UPDATES
  192.  
  193. April 4, 1997
  194. - -------------
  195. The CERT/CC has received reports that the vulnerability described in this
  196. advisory is being exploited.
  197.  
  198. January 14, 1997
  199. - ----------------
  200. All HP patches are now available, see HEWLETT-PACKARD SECURITY BULLETIN:
  201. #00048, issued on 09 January 1997:
  202.  
  203.           PHCO_9603  for all platforms with HP-UX releases 9.X
  204.           PHCO_9604  for all platforms with HP-UX releases 10.00/10.01
  205.           PHCO_9605  for all platforms with HP-UX releases 10.10/10.20
  206.  
  207.    Fixing the problem
  208.  
  209.       The vulnerability can be eliminated from HP-UX releases 9.X and
  210.       10.X by applying the appropriate patch.
  211.  
  212.    Recommended solution
  213.  
  214.       1.  Determine which patch are appropriate for your operating
  215.           system.
  216.  
  217.       2.  Hewlett-Packard's HP-UX patches are available via email
  218.           and the World Wide Web
  219.  
  220.           To obtain a copy of the Hewlett-Packard SupportLine email
  221.           service user's guide, send the following in the TEXT PORTION
  222.           OF THE MESSAGE to support@us.external.hp.com (no Subject
  223.           is required):
  224.  
  225.                                send guide
  226.  
  227.           The users guide explains the HP-UX patch downloading process
  228.           via email and other services available.
  229.  
  230.           World Wide Web service for downloading of patches
  231.           is available via our URL:
  232.                   (http://us.external.hp.com)
  233.  
  234.       3.  Apply the patch to your HP-UX system.
  235.  
  236.       4.  Examine /tmp/update.log (9.X), or /var/adm/sw/swinstall.log
  237.           (10.X), for any relevant WARNING's or ERROR's.
  238.  
  239.  
  240. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  241. Revision history
  242.  
  243. Apr. 04, 1997  Updates - added note that the vulnerability is being exploited. 
  244. Jan. 14, 1997  Updates - added patch information.
  245.  
  246. -----BEGIN PGP SIGNATURE-----
  247. Version: 2.6.2
  248.  
  249. iQCVAwUBM0PA7HVP+x0t4w7BAQHHWAQAvFqQngkTvwogTy+v+mRcNgYvygWKgn0g
  250. jYJrt0UUQ995mLJhMp4PWa0KiEczOAOtjMROq/a9t/6G+LdIuxSnTpI2XONcWOmt
  251. RzB7CnV1iyY7gFElqvmUSPte4+6lzq5pm3eVHOcRWAeEMUJbd8FndIe7h2yF+z9v
  252. xm7pp5VdDHU=
  253. =2f35
  254. -----END PGP SIGNATURE-----
  255.  
  256.