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

  1.  
  2. -----BEGIN PGP SIGNED MESSAGE-----
  3.  
  4. =============================================================================
  5. CERT(sm) Advisory CA-96.10                     
  6. Original issue date: May 28, 1996
  7. Last revised: August 30, 1996
  8.               Information previously in the README was inserted
  9.               into the advisory.
  10.  
  11.               A complete revision history is at the end of this file.
  12.  
  13. Topic:  NIS+ Configuration Vulnerability
  14. - -----------------------------------------------------------------------------
  15.  
  16.    The text of this advisory was originally released by the Australian
  17.    Emergency Response Team on May 20, 1996, and updated on May 27, 1996, as
  18.    AUSCERT advisory AA-96.02a.
  19.  
  20.    Because of the seriousness of the problem, we are reprinting the AUSCERT
  21.    advisory here with their permission. Only the contact information at the
  22.    end has changed: AUSCERT contact information has been replaced with
  23.    CERT/CC contact information. 
  24.  
  25.    We will update this advisory as we receive additional information.
  26.    Please check advisory files regularly for updates that relate to your site.
  27.  
  28. =============================================================================
  29.  
  30. AUSCERT has received information that a vulnerability exists under some
  31. configurations of NIS+.  In vulnerable installations of NIS+, the access
  32. rights on the NIS+ passwd table are left in an unsecure state.
  33.  
  34. This vulnerability is known to exist in NIS+ installations initially created
  35. on Solaris 2.5 servers.  Similar vulnerabilities in NIS+ configurations may
  36. also exist in previous versions of Solaris 2.
  37.  
  38. This vulnerability may allow any user with valid NIS+ credentials to gain
  39. root privileges.
  40.  
  41. AUSCERT recommends that any site which has NIS+ installed take this
  42. opportunity to check their installations and apply the appropriate 
  43. workarounds as described in Section 3.
  44.  
  45. ** This updated advisory contains clarifications for sites requiring password
  46. ** aging facilities and sites running their NIS+ servers in NIS compatibility
  47. ** mode.
  48.  
  49. - -----------------------------------------------------------------------------
  50.  
  51. 1.  Description
  52.  
  53.     NIS+ provides distributed network access to information sources such as
  54.     password, group and host information.  It maintains this information in
  55.     the form of NIS+ tables.  NIS+ tables contain the administrative
  56.     information normally supplied by local files (such as /etc/passwd).  As
  57.     with the standard Unix administration files, setting secure permissions
  58.     on the NIS+ tables is of utmost importance in maintaining system 
  59.     security.
  60.  
  61.     NIS+ provides a comprehensive set of access rights for NIS+ tables.  This
  62.     includes permissions not only on NIS+ tables but also individual columns
  63.     and entries in those tables.  Due to the added complexity, sites need to
  64.     be particularly diligent in ensuring that permissions on NIS+ tables (and
  65.     associated entries and columns) are secure.
  66.  
  67.     AUSCERT encourages sites running NIS+ to gain a good understanding of
  68.     the permission model used by NIS+.  A complete description may be found
  69.     in the NIS+ documentation set.  The rest of this advisory assumes a good
  70.     understanding of NIS+ permission controls.
  71.  
  72.     AUSCERT has received information that under some installations of NIS+
  73.     the permissions on the NIS+ passwd table are left in an unsecure state.
  74.  
  75.     This vulnerability is known to exist in NIS+ installations initially
  76.     created on Solaris 2.5 servers.  Similar vulnerabilities in NIS+
  77.     configurations may also exist in previous versions of Solaris 2.
  78.  
  79. 2.  Impact
  80.  
  81.     Any user with login access to a client or server that uses NIS+ for
  82.     authentication may gain root privileges.
  83.  
  84. 3.  Workarounds
  85.  
  86.     NIS+ uses an access control mechanism for granting access to NIS+ tables
  87.     which is similar (but not identical) to that used by the standard Unix
  88.     file system.  NIS+ tables are assigned permissions for the NIS+ user
  89.     categories nobody, owner, group and world.  NIS+ also has permissions
  90.     associated with columns and individual entries in NIS+ tables.
  91.  
  92.     Under some installations of NIS+ the permissions of the NIS+ passwd
  93.     table and its columns are left in an unsecure state.  These permissions
  94.     can be viewed using niscat(1).
  95.  
  96.     To check the permissions on the NIS+ passwd table, sites can use:
  97.  
  98.     # niscat -o passwd.org_dir
  99.  
  100.     This should produce output similar to:
  101.  
  102. Object Name   : passwd
  103. Owner         : myhost.mydomain.org.
  104. Group         : admin.mydomain.org.
  105. Domain        : org_dir.mydomain.org.
  106. Access Rights : ----rmcdrmcd----
  107. Time to Live  : 12:0:0
  108. Object Type   : TABLE
  109. Table Type          : passwd_tbl
  110. Number of Columns   : 8
  111. Character Separator : :
  112. Search Path         :
  113. Columns             :
  114.         [0]     Name          : name
  115.                 Attributes    : (SEARCHABLE, TEXTUAL DATA, CASE SENSITIVE)
  116.                 Access Rights : r---------------
  117.         [1]     Name          : passwd
  118.                 Attributes    : (TEXTUAL DATA)
  119.                 Access Rights : -----m----------
  120.         [2]     Name          : uid
  121.                 Attributes    : (SEARCHABLE, TEXTUAL DATA, CASE SENSITIVE)
  122.                 Access Rights : r---------------
  123.         [3]     Name          : gid
  124.                 Attributes    : (TEXTUAL DATA)
  125.                 Access Rights : r---------------
  126.         [4]     Name          : gcos
  127.                 Attributes    : (TEXTUAL DATA)
  128.                 Access Rights : r---------------
  129.         [5]     Name          : home
  130.                 Attributes    : (TEXTUAL DATA)
  131.                 Access Rights : r---------------
  132.         [6]     Name          : shell
  133.                 Attributes    : (TEXTUAL DATA)
  134.                 Access Rights : r---------------
  135.         [7]     Name          : shadow
  136.                 Attributes    : (TEXTUAL DATA)
  137.                 Access Rights : ----------------
  138.  
  139.     This output shows two types of access rights associated with the NIS+
  140.     passwd table.  First, the default access rights for the table, which are
  141.     given at the start of the output (----rmcdrmcd----).  Second,  the access
  142.     rights associated with each column.
  143.  
  144.     In particular, sites should check the access rights on the columns of
  145.     the NIS+ passwd table.  It should be noted that it appears that individual
  146.     entries of the passwd table are owned by individual users.  The above
  147.     access rights do not allow a user to modify any part of their passwd
  148.     table entry besides their own passwd field.  For many environments this
  149.     is acceptable.  
  150.  
  151.     However, depending on the local site configuration and requirements,
  152.     additional access rights may also be needed.
  153.  
  154.     - Sites that wish users to be able to change their shell or gcos
  155.     information may have the (m)odify bit set for owner on the shell or gcos
  156.     column as needed.
  157.  
  158.     - Sites that have their NIS+ servers running in NIS compatibility
  159.     mode to serve NIS clients may require (r)ead permission for nobody on the
  160.     NIS+ passwd table.
  161.  
  162.     - Sites that are using password aging may require additional access
  163.     rights on the shadow column.  The exact access rights will depend on the
  164.     particular NIS+ version (including patches).  Sites are encouraged to
  165.     check their local documentation for more information.
  166.  
  167.     Other than this, the access rights on columns should appear as shown in
  168.     the niscat(1) output above.
  169.  
  170.     Any additional access rights on the table or its columns besides those
  171.     shown above may allow a user to gain additional privileges, including
  172.     possibly root.  Sites should completely understand the ramifications if
  173.     they allow additional access rights.
  174.  
  175.     Sites may set the access rights on the NIS+ passwd table, as shown in the
  176.     above output, by issuing the following commands as root on the master 
  177.     NIS+ server.
  178.  
  179.     To set the default access rights for the NIS+ passwd table:
  180.  
  181.         # nischmod na-rmcd,og+rmcd passwd.org_dir
  182.  
  183.     To set the column access rights on the NIS+ passwd table:
  184.  
  185.         # nistbladm -u name=na-rmcd,n=r passwd.org_dir
  186.         # nistbladm -u passwd=na-rmcd,o=m passwd.org_dir
  187.         # nistbladm -u uid=na-rmcd,n=r passwd.org_dir
  188.         # nistbladm -u gid=na-rmcd,n=r passwd.org_dir
  189.         # nistbladm -u gcos=na-rmcd,n=r passwd.org_dir
  190.         # nistbladm -u home=na-rmcd,n=r passwd.org_dir
  191.         # nistbladm -u shell=na-rmcd,n=r passwd.org_dir
  192.         # nistbladm -u shadow=na-rmcd passwd.org_dir
  193.  
  194.     After making any changes in access rights, AUSCERT recommends that sites
  195.     verify the changes they have made using niscat(1), as shown previously.
  196.  
  197.     Sites that have replica NIS+ servers may use nisping(1m) to propagate
  198.     the changes to the replica servers in a timely manner.
  199.  
  200. 4.  Additional measures
  201.  
  202.     AUSCERT recommends that sites take this opportunity to ensure that all
  203.     NIS+ tables have access rights in accordance with the local site security
  204.     policy.  This also includes checking access rights on all the columns
  205.     and entries of the NIS+ tables in addition to the default access rights
  206.     of the tables themselves.
  207.  
  208. - -----------------------------------------------------------------------------
  209. AUSCERT wishes to thank Ivan Angus and David Clarke of ANU for reporting this
  210. vulnerability and for their advice in the preparation of this advisory.
  211. AUSCERT also acknowledges Marek Krawus of UQ,  Reinhard Uebel and Mark
  212. McPherson of QTAC for their assistance.
  213. - -----------------------------------------------------------------------------
  214.  
  215. The AUSCERT team have made every effort to ensure that the information
  216. contained in this document is accurate.  However, the decision to use the
  217. information described is the responsibility of each user or organisation.
  218. The appropriateness of this document for an organisation or individual system
  219. should be considered before application in conjunction with local policies
  220. and procedures.  AUSCERT takes no responsibility for the consequences of
  221. applying the contents of this document.
  222.  
  223. =============================================================================
  224.  
  225. CERT Contact Information
  226. - ------------------------
  227.  
  228. If you believe that your system has been compromised, contact the CERT
  229. Coordination Center or your representative in the Forum of Incident
  230. Response and Security Teams (FIRST).
  231.  
  232. We strongly urge you to encrypt any sensitive information you send by email.
  233. The CERT Coordination Center can support a shared DES key and PGP. Contact 
  234. the CERT staff for more information. 
  235.  
  236. Location of CERT PGP key
  237.          ftp://info.cert.org/pub/CERT_PGP.key
  238.  
  239.  
  240. Email    cert@cert.org
  241.  
  242. Phone    +1 412-268-7090 (24-hour hotline)
  243.                 CERT personnel answer 8:30-5:00 p.m. EST
  244.                 (GMT-5)/EDT(GMT-4), and are on call for
  245.                 emergencies during other hours.
  246.  
  247. Fax      +1 412-268-6989
  248.  
  249. Postal address
  250.         CERT Coordination Center
  251.         Software Engineering Institute
  252.         Carnegie Mellon University
  253.         Pittsburgh PA 15213-3890
  254.         USA
  255.  
  256. CERT publications, information about FIRST representatives, and other
  257. security-related information are available for anonymous FTP from
  258.         http://www.cert.org/
  259.         ftp://info.cert.org/pub/
  260.  
  261. CERT advisories and bulletins are also posted on the USENET newsgroup
  262.         comp.security.announce
  263.  
  264. To be added to our mailing list for CERT advisories and bulletins, send your
  265. email address to
  266.         cert-advisory-request@cert.org
  267.  
  268.  
  269. Copyright 1996 Carnegie Mellon University
  270. This material may be reproduced and distributed without permission provided
  271. it is used for noncommercial purposes and the copyright statement is 
  272. included.
  273.  
  274. CERT is a service mark of Carnegie Mellon University.
  275.  
  276. ==============================================================================
  277. UPDATES
  278.  
  279. CERT/CC received information concerning an additional problem with the
  280. ROW access rights in the NIS+ password table.  Accounts created on
  281. Solaris 2.4 and 2.5 systems have excessive rights on the system.
  282. These new super accounts have read, modify, create, and delete access
  283. rights on their own rows in the nisplus password table.  This means
  284. they can alter all attributes on their own entries.
  285.  
  286. To determine if your system is so affected, execute the following:
  287.  
  288.         % niscat -o '[name=juke],passwd.org_dir' | egrep "Access"
  289.  
  290. If the output displays information similar to the following:
  291.  
  292.           Access Rights : ----rmcdr---r---
  293.                               ^^^^
  294. then the owner can read, modify, change, and delete information.
  295.  
  296. The rights at this level should be more restrictive, and the individual rights
  297. on entries should be less restrictive.  The less restrictive rights on entries
  298. allow a user to change their password entry, the GECOS field, and even the
  299. shell depending upon how the entry rights are set.
  300.  
  301. The output from the niscat above should look like the following:
  302.  
  303.           Access Rights : ----r-----------
  304.  
  305. This allows only the user to read information from the password table.
  306.  
  307. One way to determine which entries in the password table need to be changed is
  308. the following:
  309.  
  310.         % niscat -o '[ ],passwd.org_dir' | egrep "Owner|rmc"
  311.  
  312. To fix the entries, use the following:
  313.  
  314.           % nischmod o=r,ngw-rmdc '[ ],passwd.org_dir'
  315.  
  316. This sets the owner permissions to r (read) and removes all permissions from
  317. nobody, group, and world.
  318.  
  319. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  320. Revision history
  321.  
  322. Aug. 30, 1996  Information previously in the README was inserted into the
  323.                advisory.
  324.                Beginning of the advisory - removed AUSCERT advisory header
  325.                to avoid confusion.
  326. June 12, 1996  Updates section - added clarification concerning ROW access
  327.                rights.
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336. -----BEGIN PGP SIGNATURE-----
  337. Version: 2.6.2
  338.  
  339. iQCVAwUBMiTCFnVP+x0t4w7BAQGCNgP9HzQyAGwZKH0XxXctYdq6u+9I9QPkAmG9
  340. BGpgug7ZFcL1P+9R/M+1yOCMS4UScwiTeaeT3iMb0uCXeKmEUtC526uv7eLqb1RA
  341. GeT8+BAkAym943l/LOpnfmUJgCWHKv39DZJXUym5SWM9BpDwPW+u0eIsoycNuhWZ
  342. Qa5aDuncx7o=
  343. =GFo0
  344. -----END PGP SIGNATURE-----
  345.  
  346.