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

iDEFENSE Security Advisory 2005-02-21.2

iDEFENSE Security Advisory 2005-02-21.2
Posted Feb 26, 2005
Authored by iDefense Labs, infamous41md | Site idefense.com

iDEFENSE Security Advisory 02.21.05 - Remote exploitation of a stack-based buffer overflow in various Unix / Linux vendors implementations of cURL could allow for arbitrary code execution on the targeted host. An exploitable stack-based buffer overflow condition exists when using NT Lan Manager (NTLM) authentication.

tags | advisory, remote, overflow, arbitrary, code execution
systems | linux, unix
SHA-256 | 747bd27de063e14c01ea3bbdf599000f8a09b4f4b02690d729244fdbd998fe3e

iDEFENSE Security Advisory 2005-02-21.2

Change Mirror Download
Multiple Unix/Linux Vendor cURL/libcURL NTLM Authentication Buffer
Overflow Vulnerability

iDEFENSE Security Advisory 02.21.05:
www.idefense.com/application/poi/display?id=202&type=vulnerabilities
February 21, 2005

I. BACKGROUND

cURL is a command line tool for transferring files with URL syntax,
supporting FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP.
More information about cURL and libcURL is available from:

http://curl.haxx.se/

II. DESCRIPTION

Remote exploitation of a stack-based buffer overflow in various Unix /
Linux vendors implementations of cURL could allow for arbitrary code
execution on the targeted host.

An exploitable stack-based buffer overflow condition exists when using
NT Lan Manager (NTLM) authentication. The problem specifically exists
within Curl_input_ntlm() defined in lib/http_ntlm.c. Within this
function an unsigned stack-based character array of size 256, buffer[],
is passed to the Curl_base64_decode() routine defined in lib/base64.c as
can be seen here:

size_t size = Curl_base64_decode(header, (char *)buffer);

The Curl_base64_decode() routine relies on the calling function to
validate the decoded length. This function base64 decodes and copies
data directly from the HTTP reply of a server to the destination buffer,
in this case buffer[]. An attacker can construct a long base64 encoded
malicious payload that upon decoding will overflow the 256 byte static
buffer and overwrite the saved EIP. This in turn can lead to arbitrary
code execution.

III. ANALYSIS

Successful exploitation allows remote attackers to execute arbitrary
code
under the privileges of the target user. Exploitation requires that an
attacker either coerce or force a target to connect to a malicious
server using NTLM authentication.

IV. DETECTION

iDEFENSE has confirmed the existence of this vulnerability in cURL
version 7.12.1. It is suspected that prior versions are affected as
well.
Any application built using a vulnerable version libcURL will also be
affected.

V. WORKAROUND

Replace the static buffer allocation on line 106 in lib/http_ntlm.c:

unsigned char buffer[256];

With a dynamic buffer allocation:

unsigned char *buffer = (unsigned char *)malloc(strlen(header));

and recompile cURL.

VI. VENDOR RESPONSE

No vendor response received.

VII. CVE INFORMATION

A Mitre Corp. Common Vulnerabilities and Exposures (CVE) number has not
been assigned yet.

VIII. DISCLOSURE TIMELINE

12/21/2004 Initial vendor notification - No response
02/10/2005 Secondary vendor notification - No response
02/21/2005 Public disclosure

IX. CREDIT

infamous41md[at]hotpop.com is credited with this discovery.

Get paid for vulnerability research
http://www.idefense.com/poi/teams/vcp.jsp

X. LEGAL NOTICES

Copyright (c) 2005 iDEFENSE, Inc.

Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDEFENSE. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email customerservice@idefense.com for permission.

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.

Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    0 Files
  • 17
    Sep 17th
    0 Files
  • 18
    Sep 18th
    0 Files
  • 19
    Sep 19th
    0 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close