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

  1.  
  2.             ######    ##   ##    ######
  3.             ##        ###  ##      ##
  4.             ######    ## # ##      ##
  5.                 ##    ##  ###      ##
  6.             ###### .  ##   ## .  ######.
  7.  
  8.                 Secure Networks Inc.
  9.  
  10.                  Security Advisory
  11.                  December 16, 1996
  12.  
  13.              Vulnerability in Vixie Cron
  14.  
  15. During September, we became aware of a vulnerability in Vixie Cron 2.1
  16. which allows attackers to obtain root access.  It is recommended that
  17. security conscious administrators apply the attached patch.
  18.  
  19. Technical Details
  20. ~~~~~~~~~~~~~~~~~
  21. One of the many features of Vixie Cron 2.1 is that it allows users to
  22. set environment variables in their crontab.  In parsing these environment
  23. variables, in the form:
  24. VARIABLE=VALUE
  25. it uses the function sscanf on a 1000 byte buffer.  Unfortunately, Vixie
  26. Cron 2.1 does no length checking of the variable name, and attempts to 
  27. stuff it into a 100 byte buffer.  Thus, by creating a crontab file which
  28. contains a variable with a name longer than 100 characters, it is possible
  29. to overflow the buffer, and obtain root access.
  30.  
  31. Impact
  32. ~~~~~~
  33. Users with a valid account, and permission to run cron jobs (via
  34. cron.allow and cron.deny) can obtain root access.
  35.  
  36. Vulnerable Systems
  37. ~~~~~~~~~~~~~~~~~~
  38. All systems incorporating Vixie Cron 2.1 without modifications,
  39. including, but not limited to:
  40. Redhat Linux
  41. BSD/OS 2.x
  42. OpenBSD 1.x
  43. NetBSD 1.2
  44. FreeBSD 2.1.5
  45. Any system where the default cron was replaced with Vixie Cron
  46.  
  47. Fix Information
  48. ~~~~~~~~~~~~~~~
  49. Increase the length of the buffer used by crontab to store the
  50. environment variable name to 1000 bytes.  Since the buffer that sscanf
  51. is reading can no longer than 1000 bytes, an increase in buffer
  52. length is sufficient to fix the bug.
  53.  
  54. Apply the following patch to env.c, recompile cron and crontab, then
  55. kill and restart cron.
  56.  
  57.  
  58. *** env.old     Mon Dec 16 20:09:49 1996
  59. --- env.c       Mon Dec 16 20:11:26 1996
  60. ***************
  61. *** 95,101 ****
  62.     char    *strcpy(), *sprintf();
  63.     long    filepos;
  64.     int     fileline;
  65. !       char    name[MAX_TEMPSTR], val[MAX_ENVSTR];
  66.     int     fields, strdtb();
  67.     void    skip_comments();
  68.   
  69. --- 95,101 ----
  70.     char    *strcpy(), *sprintf();
  71.     long    filepos;
  72.     int     fileline;
  73. !       char    name[MAX_ENVSTR], val[MAX_ENVSTR];
  74.     int     fields, strdtb();
  75.     void    skip_comments();
  76.   
  77.  
  78.  
  79. Copyright
  80. ~~~~~~~~~
  81. The contents of this advisory are Copyright (c) 1996 Secure Networks Inc,
  82. and may be freely reproduced provided that no fee is charged for
  83. reproduction and proper credit is given.
  84.