SkipNavigation
US-CERT
American Flag
  Vulnerability
Notes
Database

Search Vulnerability Notes

Vulnerability Notes Help Information

Report a Vulnerability

 
 View Notes By
  Name

ID Number

CVE Name

Date Public

Date Published

Date Updated

Severity Metric



 Other Documents
  Technical Alerts

Technical Bulletins

Alerts

Security Tips

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 NotifiedDate 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 Public:97-01-27
Date First Published:2003-09-25
Date Last Updated:2003-09-25
CERT Advisory: 
CVE-ID(s): 
NVD-ID(s): 
US-CERT Technical Alerts: 
Severity Metric:3.92
Document Revision:6

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

 
Page Corner Image
Copyright 2003 Carnegie Mellon University
Disclaimers and copyright information
Get a PDF Reader