Introduction

WhatsApp Web is a web-based extension of the WhatsApp application on your phone. The web application mirrors all messages sent and received, and fully synchronize your phone and your desktop computer so that users can see all messages on both devices.

WhatsApp Web is available for most WhatsApp supported platforms, including Android, iPhone (iOS), Windows Phone 8.x, BlackBerry, BB10 and Nokia smartphones. In September 2015, WhatsApp announced they had reached 900 million active users a month. At least 200M are estimated to use the WhatsApp Web interface, considering publicly available web traffic statistics.

 

Executive Summary

Check Point security researcher Kasif Dekel recently discovered significant vulnerabilities which exploit the WhatsApp Web logic and allow attackers to trick victims into executing arbitrary code on their machines in a new and sophisticated way. All an attacker needed to do to exploit the vulnerability was to send a user a seemingly innocent vCard containing malicious code. Once opened, the alleged contact is revealed to be an executable file, further compromising computers by distributing bots, ransomware, RATs, and other malwares.

 

To target an individual, all an attacker needs is the phone number associated with the account.

 

WhatsApp verified and acknowledged the security issue and have deployed the fix in web clients world-wide. To make sure you are protected, update your WhatsApp Web right now.

Check Point shared its discovery to WhatsApp on August 21, 2015. On August 27, WhatsApp rolled out the initial fix (in all versions greater than 0.1.4481) and blocked that particular feature.

 

Technical Details

WhatsApp Web allows users to view any type of media or attachment that can be sent or viewed by the mobile platform/application. This includes images, videos, audio files, locations and contact cards.

The vulnerability lies in improper filtering of contact cards, sent utilizing the popular ‘vCard’ format. This is a screenshot for a possible contact vCard sent by a malicious user:

wapp1

 

As you can see, this message (contact card) appears legitimate, like any other contact card; most users would click it immediately without giving it a second thought.

The implication of this innocent action is downloading a file which can run arbitrary code on the victim’s machine:

wapp2

 

An Initial Hole

During Kasif’s research, he found that by manually intercepting and crafting XMPP requests to the WhatsApp servers, it was possible to control the file extension of the contact card file.

He first changed the file extension to .BAT, which indicates a Windows batch (executable script) file:

wapp3

 

This means, once the victim clicks the downloaded file (which he assumes is a contact card), the code inside the batch file runs on his computer.

Let’s see what’s inside the downloaded file (i.e. the batch file):

wapp4

 

This is a standard vCard format. To run malicious code, Kasif found out an attacker could simply inject a command to the name attribute of the vCard file, separated by the ‘&’ character. When executed, Windows will attempt to run all lines in the files, including our controlled injection line.

Further research showed that no XMPP interception of crafting is needed for this attack, since any user can create such a contact with an injected payload on their phones, no hacking tools necessary:

 

wapp5

 

Once such a contact is created, all an attacker has to do is share it via the normal WhatsApp client.

But can we take it to the next level? Could we possibly discover a way to share malicious PE (.exe) files through WhatsApp’s default sharing features (no external links)?

To answer that, we have to examine WhatsApp’s communication protocols; WhatsApp uses a customized version of the open standard Extensible Messaging and Presence Protocol (XMPP).

This is how vCard messages appear over-the-wire (with some reconstruction) when sent using WhatsApp’s protocol:

wapp6

 

  • NUMBER/GROUPID: the victim’s number or group ID
  • ID: the message ID
  • TIMESTAMP: the timestamp of the sender device
  • FILENAME: the VCARD file name, <something>.exe
  • FILEDATA: the raw data of the file

We were surprised to find that WhatsApp fails to perform any validation on the vCard format or the contents of the file, and indeed when we crafted an exe file into this request, the WhatsApp web client happily let us download the PE file in all its glory:

wapp7

But wait, there’s more! Clever attackers can exploit this in more devious scenarios, using the displayed icon to enrich the scam:

wapp8

 

This simple trick opened up a vast world of opportunity for cybercriminals and scammers, in effect allowing easy “WhatsApp Phishing”. Massive exploitation of this vulnerability could have affected millions of users, failing to realize the malicious nature of the attachment.

 

Disclosure Timeline

  • August 21, 2015 – Vulnerability disclosed to the WhatsApp security team.
  • August 23, 2015 – First response received.
  • August 27, 2015 – WhatsApp rolls out fixed web clients (greater than v0.1.4481)
  • September 8, 2015 – Public disclosure

 

Conclusions

“Thankfully, WhatsApp responded quickly and responsibly to deploy an initial mitigation against exploitation of this issue in all web clients, pending an update of the WhatsApp client” said Oded Vanunu, Security Research Group Manager at Check Point. We applaud WhatsApp for such proper responses, and wish more vendors would handle security issues in this professional manner. Software vendors and service providers should be secured and act in accordance with security best practices.

Check Point continues to be on the lookout for vulnerabilities in common software and Internet platforms, disclosing issues as they are discovered, protecting consumers and customers against tomorrow’s threats.”

 

 


  1. Pingback: Cysec-rco
  2. Hey there,

    the code isn’t executed right away; the user has to click on the .bat first, don’t they? So the browser’s sandbox is still in place, eh?

    Best
    Eric

  3. Pingback: Network Online
  4. Howdy! Someone in my Facebook group shared this website with us so I
    came to check it out. I’m definitely enjoying the information. I’m
    book-marking and will be tweeting this to my followers!
    Exceptional blog and fantastic design and style.

  5. I’ve been surfing online yet I never found any information like yours article its happens best if all the blogger write some unique things like you blog….we got something else which is never expected… :)

  6. Hiya very nice site!! Guy .. Excellent .. Superb .. I’ll bookmark your blog and take the feeds also¡KI’m satisfied to search out so many helpful info here within the put up, we’d like work out extra strategies on this regard, thanks for sharing. . . . . .

  7. Thanks you so much for this great article. Whatsapp has finally brought in end to end encryption. Hope you guys are aware of it. It means no third party can see your conversations. I think its a very good move. What say??

  8. Well this article that i’ve been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share.

  9. Greetings from Ohio! I’m bored to tears at work so I decided to browse your
    blog on my iphone during lunch break. I really like the info you present here and
    can’t wait to take a look when I get home. I’m amazed at how quick your blog loaded on my phone ..

    I’m not even using WIFI, just 3G .. Anyways, awesome blog!

  10. Thanks a lot for letting us know about this security concern that hackers can use to hack a WhatsApp user’s device. We are really happy to hear that this problem has finally been resolved. I will keep coming back for more of your posts.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Please complete the equation to verify your submission. *