Exploit the possiblities


Posted Sep 2, 2004
Authored by Steven Van Acker

The bsdmainutils package versions below 6.0.15 allow for a local root compromise via the calendar program.

tags | advisory, local, root
advisories | CVE-2004-0793
MD5 | c73cdff43ca25e609eeda08860bed4bc


Change Mirror Download
Possible root compromise with calendar (bsdmainutils 6.0.x < 6.0.15)


The calendar utility is a handy little tool that informs you about upcoming
events. Each user can define his/her own calendar events. In Debian
(and possibly other distributions as this option is builtin in calendar),
calendar can be run from cron so that users get upcoming event notifications
by mail.
This can be abused to gain root access.

This vulnerability is also known CAN-2004-0793.

Systems affected

Debian testing and Debian unstable with the bsdmainutils package installed.
(Versions 6.0 to 6.0.14 are vulnerable, >=6.0.15 is not)

How calendar works

The calendar program uses event files with this format:

<date><tab><event description>

This is not all however. Calender gives users the ability to include other
event-files and define variables and macro's. To do this, it calls cpp (the C
preprocessor) on the main event file and processes the output.

When called with the "-a" option, calendar will processes the event files of
all users and send the result by mail.

The bsdmainutils package in Debian uses this feature from
Luckily, it is not enabled by default since you have to uncomment an "exit 0"
line in the cron script to activate it.

The problem

Calendar does not drop its privileges. In order to be useful when running with
the "-a" option, it needs to run as root.
By creating an event file as follows, we can get the hashed root password (on
June 28th ;) :

#define root Jun. 28<tab>cut_here
#include </etc/shadow>
Jun. 28<tab>Birthday of Steven Van Acker
Aug. 19<tab>Birthday of Andrew Griffith

(<tab> indicates an actual tab, so char '\t')

Since calendar is running as root, there will be no problem accessing the
shadow password file. The result contains the hashed password of root, which
can then be cracked.


Quick fix: don't run "calendar -a" as root !
Graham Wilson (the bsdmainutils package maintainer for Debian) has provided a
fix for this issue. Please upgrade the package :)

Thanks to Graham Wilson for solving the problem and Jacques A. Vidrine
(FreeBSD) for keeping me from making a foolish mistake ;)

-- Steven

PS: happy birthday andrewg! ;)

Steven Van Acker

[ Need a challenge ? ]
[ Visit http://www.pulltheplug.com ]


RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

December 2017

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Dec 1st
    15 Files
  • 2
    Dec 2nd
    2 Files
  • 3
    Dec 3rd
    1 Files
  • 4
    Dec 4th
    15 Files
  • 5
    Dec 5th
    15 Files
  • 6
    Dec 6th
    18 Files
  • 7
    Dec 7th
    17 Files
  • 8
    Dec 8th
    15 Files
  • 9
    Dec 9th
    13 Files
  • 10
    Dec 10th
    4 Files
  • 11
    Dec 11th
    41 Files
  • 12
    Dec 12th
    44 Files
  • 13
    Dec 13th
    25 Files
  • 14
    Dec 14th
    15 Files
  • 15
    Dec 15th
    28 Files
  • 16
    Dec 16th
    3 Files
  • 17
    Dec 17th
    13 Files
  • 18
    Dec 18th
    0 Files
  • 19
    Dec 19th
    0 Files
  • 20
    Dec 20th
    0 Files
  • 21
    Dec 21st
    0 Files
  • 22
    Dec 22nd
    0 Files
  • 23
    Dec 23rd
    0 Files
  • 24
    Dec 24th
    0 Files
  • 25
    Dec 25th
    0 Files
  • 26
    Dec 26th
    0 Files
  • 27
    Dec 27th
    0 Files
  • 28
    Dec 28th
    0 Files
  • 29
    Dec 29th
    0 Files
  • 30
    Dec 30th
    0 Files
  • 31
    Dec 31st
    0 Files

Top Authors In Last 30 Days

File Tags


packet storm

© 2016 Packet Storm. All rights reserved.

Security Services
Hosting By