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

barrossecurity-mpg123-headerautht.txt

barrossecurity-mpg123-headerautht.txt
Posted Oct 19, 2004
Authored by Carlos Barros | Site barrossecurity.com

Advisory detailing header processing vulnerabilities in mpg123-0.59r, mpg123-pre0.59s. mpg123 is prone to a buffer overflow in the function getauthfromURL. It should be possible to use this to execute arbitrary code. The impact is minimal since you can normally only exploit this locally (though it may have more impact for internet radio sites, for example).

tags | advisory, overflow, arbitrary, vulnerability
SHA-256 | d36edfd63434893c10ef0e7a6442ce8e2b7d47ce08bce1e2e7f7574aec7c8310

barrossecurity-mpg123-headerautht.txt

Change Mirror Download
                      *******************************
* Security Advisory #01, 2004 *
*******************************
Carlos Barros <barros [at] barrossecurity d0t com>
www.barrossecurity.com
******************************************************************************

Title: mpg123 buffer overflows

Vulnerable package(s):
* mpg123-pre0.59s;
* mpg123-0.59r.

Date: 08/10/2004

Legal notice:

This Advisory is Copyright (c) 2004 Carlos Barros.
Permission is granted for the redistribution of this alert electronically. It
may not be edited in any way without the express written consent of the
author.

Disclaimer:

The information in the advisory is believed to be accurate at the time of
publishing based on currently available information. Use of the information
constitutes acceptance for use in an AS IS condition. There are no warranties
with regard to this information. Neither the author nor the publisher accepts
any liability for any direct, indirect, or consequential loss or damage
arising from use of, or reliance on, this information.

Introduction:

mpg123 is a real time MPEG Audio Player for Layer 1,2 and Layer3. It can be
downloaded at: www.mpg123.de

Vulnerability details:

mpg123 is prone to a buffer overflow in the function getauthfromURL.

// httpget.c, line 114
int getauthfromURL(char *url,char *auth)
{
char *pos;

*auth = 0;

if (!(strncmp(url, "http://", 7)))
url += 7;

if( (pos = strchr(url,'@')) ) {
int i;
for(i=0;i<pos-url;i++) {
if( url[i] == '/' )
return 0;
}
strncpy(auth,url,pos-url); <-- HERE
auth[pos-url] = 0;
strcpy(url,pos+1);
return 1;
}
return 0;
}

This function is called by http_open(), line 225 from httpget.c, and passes
"purl" and "httpauth1" as parameters. purl is a dinamic allocated variable
and httpauth1 is a static (global) var with a fixed length of 256. As you
can see, getauthfromURL function copies the purl string, until a @, into
httpauth1 without checking the length. I was not able to exploit this vuln
successfull to execute arbitraty code (too lazy), but I think it is not
impossible. httpauth1 can overwrite some useful address and it is appended
into a dinamic allocated variable (request) after a base64 encoding,
overflowing this var too.

if (strlen(httpauth1) || httpauth) {
char buf[1023];
strcat (request,"Authorization: Basic ");
if(strlen(httpauth1))
encode64(httpauth1,buf);
else
encode64(httpauth,buf);
strcat (request,buf); <-- HERE
strcat (request,"\r\n");
}

This vulnerability can be trigged locally via
mpg123 -@ http://AAAAAAAAAAAAAA...AAAAA@www.somesite.com/somefile.xxx,
or remotely via crafted playlist with some file formatted as shown above.

There is another buffer overflow in the function http_open. At line 245 of
httpget.c,the prgName variable (mpg123 filename) is appended into the request
variable.

sprintf (request + strlen(request),
" HTTP/1.0\r\nUser-Agent: %s/%s\r\n",
prgName, prgVersion);

The length of this variable is not checked, so, one can create a
specially crafted symlink to overflow the request variable. It is not a
serious bug cause it can be only exploited locally and mpg123 is not SUID by
default.

Timeline:

02/10/2004: Vulnerability detected.
10/10/2004: Vendor contacted. No response.
20/10/2004: Public available

******************************************************************************

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