CERT home
vulnerabilities & fixesevaluations & practicesresearch & analysistraining & education
homesearchFAQsite indexcontact
Vulnerability
Notes
Database

Search Vulnerability Notes

Vulnerability Notes Help Information
 

 View Notes By
Name

ID Number

CVE Name

Date Public

Date Published

Date Updated

Severity Metric

Vulnerability Note VU#6901

Solaris libc getopt(3) contains buffer overflow

Overview

Solaris libc getopt(3) contains a buffer overflow vulnerability. Please note the date of this report: 1/27/1997. This does not affect current versions of Solaris.

I. Description

From <http://www.atstake.com/research/advisories/1997/getopt.txt>:

    A buffer overflow condition exists in the getopt(3) routine in Solaris libc. By supplying an invalid option and replacing argv[0] of a SUID program that uses the getopt(3) function with the appropriate address and machine code instructions, it is possible to overwrite the saved stack frame and upon return(s) force the processor to execute user supplied instructions with elevated permissions.

II. Impact

A local user can gain root access.

III. Solution

Please see <http://au.sunsolve.sun.com/pub-cgi/retrieve.pl?type=0&doc=secbull%2F141&display=plain>.

From <http://www.atstake.com/research/advisories/1997/getopt.txt>:

    For those with source:
    If you are one of the few people who have a source code license the fix should be fairly simple. Replace the sprintf() routine in getopt.c with snprintf() and rebuld libc.

    Super Ugly kludge fix:
    If you don't have the source code available (like most of us), one solution is to use adb to change the name for getopt with something like getopz, yank a publicly available getopt.c, and put it in place of getopt.
See also section 4. of <http://au.sunsolve.sun.com/pub-cgi/retrieve.pl?type=0&doc=secbull%2F141&display=plain>.

Systems Affected

VendorStatusDate Updated
Sun Microsystems Inc.Vulnerable25-Sep-2003

References


http://www.atstake.com/research/advisories/1997/getopt.txt
http://au.sunsolve.sun.com/pub-cgi/retrieve.pl?type=0&doc=secbull%2F141&display=plain

Credit

Thanks to L0pht/@stake and Sun for information used in this document.

This document was written by James T. Ellis and updated by Art Manion.

Other Information

Date Public01/27/1997
Date First Published09/25/2003 10:21:57 AM
Date Last Updated09/25/2003
CERT Advisory 
CVE Name 
Metric3.92
Document Revision6

If you have feedback, comments, or additional information about this vulnerability, please send us email.
 

Copyright 2003 Carnegie Mellon University