what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

calendar_advisory.txt

calendar_advisory.txt
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
SHA-256 | 60b8be5b945488f25d2fc43b427af907f6ab743a5b15c6d0122ee49597c41966

calendar_advisory.txt

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

Introduction
------------

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
/etc/cron.daily/bsdmainutils.
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.


Solution
--------

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 ;)

greets,
-- Steven

PS: happy birthday andrewg! ;)

Steven Van Acker
deepstar@ulyssis.org

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

Login or Register to add favorites

File Archive:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close