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

popper.txt

popper.txt
Posted Aug 17, 1999

No information is available for this file.

tags | paper
SHA-256 | ab74984b9425755d529033e4de66dfb4eb23b3b4fdb00471f10c028866767c07

popper.txt

Change Mirror Download
**************************************************************************
HACK: Shell access users can use "popper" to create root owned files
System: Unix
Source: Mark Fullmer (maf@cob.ohio-state.edu) from Bugtraq
Date: Fri, 6 May 1994
**************************************************************************

On systems that have /var/spool/mail mode 'drwsrwxrwt' and use the Berkeley
popper daemon, users that have access to /var/spool/mail (ie. a user with a
shell login) can create arbitrary root owned files on the host that popper
is executed on.Depending on the umask that popper was run with, this file may also be world
writeable.

Details: version UCB Pop server (version 1.831beta)

#line 59 of pop_dropcopy.c:
# currently running as root: (POP_TMPDROP is /usr/spool/mail/tmpXXXXXX)

> strcpy(template,POP_TMPDROP);
> (void) mktemp(template);

# The race starts.
# if a user guesses the pathname in "template", they could of previously
# made a link to say /etc/nologin.

# instead of script to exploit this bug, you can verify it exists by adding
# sleep(30) here -- after the mktemp(), before the fopen(), which will make the
# race condition easy to win. Ofcourse, you allready need to be root to be
# able to do this...

> if ( (tf=fopen(template,"w+")) == NULL ) { /* failure, bail out */
> pop_log(p,POP_PRIORITY,
> "Unable to create temporary temporary maildrop '%s': %s",template,
> (errno < sys_nerr) ? sys_errlist[errno] : "") ;
> return pop_msg(p,POP_FAILURE,
> "System error, can't create temporary file.");
> }

# at this point, the file is created. Depending on the umask that popper was
# run with, this file may have world write permission.

# chown/chmod won't follow your link.
> /* Now give this file to the user */
> (void) chown(template,pwp->pw_uid, pwp->pw_gid);]
> (void) chmod(template,0600);
> /* Now link this file to the temporary maildrop. If this fails it
> * is probably because the temporary maildrop already exists. If so,
> * this is ok. We can just go on our way, because by the time we try
> * to write into the file we will be running as the user.
> */
> (void) link(template,p->temp_drop);
> (void) fclose(tf);
> (void) unlink(template);

> /* Now we run as the user. */
> (void) setuid(pwp->pw_uid);
> (void) setgid(pwp->pw_gid);

Solution. If your /var/spool/mail is mode 'drwsrwxrwt' this code isn't
necessary. Remove lines 59-82 of pop_dropcopy.c. This doesn't entirely
solve the problem, especially if root reads their mail via popper. The
best solution is to not have /var/spool/mail with world write permissions,
as this same type of problem exists in atleast one delivery agent (/bin/mail),
and probably in user agents.
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
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 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