Q
Problem solve Get help with specific problems with your technologies, process and projects.

How did flaws in WhatsApp and Telegram enable account takeovers?

Flaws in WhatsApp and Telegram, popular messaging services, enable attackers to break encryption and take over accounts. Expert Michael Cobb explains how the attacks work.

Researchers at Check Point Software Technologies found vulnerabilities in encrypted messaging services WhatsApp...

and Telegram that enable attackers to access users' conversations and files and to take over their accounts. The flaw occurs in the web versions of these apps. What is the issue, and how does the flaw break encryption?

The messaging services WhatsApp and Telegram are popular with users because they provide end-to-end encryption; this means that any messages sent between users are encrypted on the device before the message is sent and can only be decrypted by the recipient. Neither the WhatsApp nor the Telegram servers can read the contents of messages sent between users.

However, this data security and privacy measure creates a situation that hackers could abuse to access users' messages and files, and even to take over their accounts. End-to-end encryption prohibits the scanning of messages for viruses or other malicious code sent via either service.

Researchers at Check Point Software Technologies discovered that the way both WhatsApp and Telegram process images and multimedia attachments on their web-based applications could enable an attacker to send a seemingly innocuous file, which in fact contains malicious code, to a victim.

The WhatsApp web client limits the types of files that can be uploaded by a user and sent as an attachment. However, messages are encrypted before the type of attachment the user is sending has been validated. This means that it is possible to change the file type variable and then encrypt the file in order to bypass the restriction on allowed file types. This could enable an attacker to craft a malicious HTML file with a legitimate image preview designed to trick the recipient into opening it.

This image is actually hiding an HTML5 FileReader object, so if the recipient clicks on it, the WhatsApp web client takes them to the attacker's malicious HTML page. Once loaded, a JavaScript function in the malicious HTML file can send the victim's local storage data to the attacker, enabling him to take over the account and access anything in it.

As a security measure, WhatsApp doesn't allow a client to have more than one active session open at a time, but the attacker can use another JavaScript function to cause the client browser window to hang and to prevent the victim from interfering with the attack.

The Check Point attack against Telegram is similar, but uses a mime type of a video file to bypass Telegram's upload policy to upload a malicious HTML document. Once the victim opens the video in a new browser tab, it starts playing, and the users' session data is sent to the attacker. However, this attack only works if the victim is using the Chrome browser and follows a specific set of unusual steps, although they wouldn't be aware of the attack since Telegram allows users to keep more than one active session open at the same time.

End-to-end encryption is an essential security mechanism, but in this case, it is the cause of a vulnerability. By encrypting a message's content prior to validating it, the client-side file upload checks can be bypassed.

This vulnerability only affects the web platforms of each service, and both WhatsApp and Telegram have issued fixes to protect against the attack by validating content before encrypting it. All that's required from users is a browser restart to ensure they are using the latest version of the app.

As always, WhatsApp and Telegram users should be wary of opening links and files from unknown users. Using two-factor authentication on important accounts and services is another security control that can prevent attacks looking to illegally access accounts.

Ask the expert:
Want to ask Michael Cobb a question about application security? Submit your questions now via email. (All questions are anonymous.)

Next Steps

Learn about the importance of end-to-end encryption on team chat applications

Find out how a bug in the Signal app enabled attackers to alter encrypted attachments

Read about the growing popularity of team messaging apps and its effect on other forms of communication

This was last published in August 2017

Dig Deeper on Disk and file encryption tools

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Join the conversation

1 comment

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

What messaging services do you consider to be secure enough for enterprise use?
Cancel

-ADS BY GOOGLE

SearchCloudSecurity

SearchNetworking

SearchCIO

SearchEnterpriseDesktop

SearchCloudComputing

ComputerWeekly

Close