Share your story
The central voice for Linux and Open Source security news
Home News Topics Advisories HOWTOs Features Newsletters About Register

Sign up!
EnGarde Community
What is the most important Linux security technology?
Linux Events
Linux User Groups
Link to Us
Security Center
Book Reviews
Security Dictionary
Security Tips
White Papers
Featured Blogs
All About Linux
DanWalsh LiveJournal
Latest Newsletters
Linux Security Week: March 30th, 2015
Linux Advisory Watch: March 27th, 2015
LinuxSecurity Newsletters
Choose Lists:
About our Newsletters
RSS Feeds
Get the LinuxSecurity news you want faster with RSS
Powered By

FreeBSD-SA-96:13:unauthorized mail reading via comsat Print E-mail
User Rating:      How can I rate this item?
Posted by Team   
FreeBSD The comsat daemon does not properly set privileges before attempting to read mail files for display on a user terminal.

FreeBSD-SA-96:13                                            Security Advisory
                                                                FreeBSD, Inc.

Topic:          unauthorized mail reading via comsat

Category:       core
Module:         comsat
Announced:      1996-06-05
Affects:        All FreeBSD versions
Corrected:      2.1-stable and 2.2-current as of 1996-06-04
FreeBSD only:   yes



I.   Background    

     FreeBSD made an extension to the comsat daemon to support
     e-mail in alternate locations.  A bug was found in this
     extension which allows an unprivileged local user to read
     portions of other users' mail.

     This problem is present in all source code and binary
     distributions of FreeBSD released before 1996-06-03.

II.  Problem Description

     The comsat daemon does not properly set privileges before
     attempting to read mail files for display on a user terminal.

III. Impact

     The comsat daemon may be used to read portions of files
     in /var/mail that would not normally be accessible to a
     particular user.  This ability is limited to the /var/mail
     directory hierarchy.

     This vulnerability can only be exploited by users with a valid
     account on the local system.

IV. Workaround

     One may simply disable the comsat daemon in /etc/inetd.conf.
     This will disable asynchronous notification of received mail
     (biff messages).  This workaround will suffice for
     all versions of FreeBSD affected by this problem.
     As root, edit the file /etc/inetd.conf and change the line

     comsat     dgram   udp     wait    root    /usr/libexec/comsat     comsat

     to read

     #comsat    dgram   udp     wait    root    /usr/libexec/comsat     comsat

     and then reboot the system or restart the inetd daemon and kill
     off any active comsat daemons.

V. Solution

     The following patch fixes the permissions problem.  It should
     apply cleanly to all FreeBSD 2.x systems.  It has not been tested
     with FreeBSD 1.x but this change, if applied by hand, should work.

    --- comsat.c        Mon Jun  3 09:07:49 1996
    +++ comsat.c        Mon Jun  3 09:17:11 1996
    @@ -73,7 +73,7 @@
     time_t     lastmsgtime;
     int        nutmp, uf;
    -void jkfprintf __P((FILE *, char[], off_t));
    +void jkfprintf __P((FILE *, char[], char[], off_t));
     void mailfor __P((char *));
     void notify __P((struct utmp *, char[], off_t, int));
     void onalrm __P((int));
    @@ -238,15 +238,16 @@
                cr, name, (int)sizeof(hostname), hostname,
                folder ? cr : "", folder ? "to " : "", folder ? file : "",
                cr, cr);
    -   jkfprintf(tp, file, offset);
    +   jkfprintf(tp, name, file, offset);
    -jkfprintf(tp, name, offset)
    +jkfprintf(tp, user, file, offset)
            register FILE *tp;
    -   char name[];
    +   char user[];
    +   char file[];
            off_t offset;
            register char *cp, ch;
    @@ -256,10 +257,10 @@
            char line[BUFSIZ];
            /* Set effective uid to user in case mail drop is on nfs */
    -   if ((p = getpwnam(name)) != NULL)
    +   if ((p = getpwnam(user)) != NULL)
                    (void) setuid(p->pw_uid);
    -   if ((fi = fopen(name, "r")) == NULL)
    +   if ((fi = fopen(file, "r")) == NULL)
            (void)fseek(fi, offset, L_SET);

FreeBSD, Inc.

Web Site:             
Confidential contacts:
PGP Key:              
Security notifications:
Security public discussion:

Notice: Any patches in this document may not apply cleanly due to
        modifications caused by digital signature or mailer software.
        Please reference the URL listed at the top of this document
        for original copies of all patches if necessary.

Version: 2.6.2

< Prev   Next >


Latest Features
Peter Smith Releases Linux Network Security Online
Securing a Linux Web Server
Password guessing with Medusa 2.0
Password guessing as an attack vector
Squid and Digest Authentication
Squid and Basic Authentication
Demystifying the Chinese Hacking Industry: Earning 6 Million a Night
Free Online security course (LearnSIA) - A Call for Help
What You Need to Know About Linux Rootkits
Review: A Practical Guide to Fedora and Red Hat Enterprise Linux - Fifth Edition
Weekend Edition
FBI Quietly Removes Recommendation To Encrypt Your Phone
And the prize for LEAST SECURE BROWSER goes to ... Chrome!
Partner Sponsor

Community | HOWTOs | Blogs | Features | Book Reviews | Networking
 Security Projects |  Latest News |  Newsletters |  SELinux |  Privacy |  Home
 Hardening |   About Us |   Advertise |   Legal Notice |   RSS |   Guardian Digital
(c)Copyright 2015 Guardian Digital, Inc. All rights reserved.