A critical vulnerability has been discovered in the Telegram Web application, posing a significant risk of session hijacking and compromising user privacy and security. This vulnerability specifically targets versions of Telegram WebK below 2.0.0, affecting a broad spectrum of users, including those utilizing web3 technologies. Identified as a Cross-Site Scripting (XSS) flaw, this vulnerability allows threat actors to gain unauthorized access to Telegram user sessions by exploiting the ability to execute arbitrary JavaScript within the Telegram web environment.
The technical details of the vulnerability reveal that it originates from the Mini Apps feature within the Telegram Messenger Interface. This feature is intended to allow web applications to operate within Telegram but has inadvertently created a security loophole. Malicious Mini Web Apps can execute JavaScript under the guise of being legitimate components of web.telegram.org. The exploitation is facilitated through the web_app_open_link event type, which can be manipulated to embed malicious content within the JavaScript of the web.telegram.org domain, leading to session hijacking.
In response to the discovery of this critical flaw, Telegram acted swiftly to mitigate the potential threats. The patches implemented by Telegram include the addition of a safeWindow URL and the application of the noreferrer argument to the opening of new tabs. These measures are designed to enhance security by preventing newly opened windows from sending the Referer header back to the original page, which is a common vector for XSS attacks.
Users of Telegram Web are strongly encouraged to update their application to the latest version, specifically to Telegram WebK 2.0.0 (488) or later. This update is crucial for safeguarding against the exploitation of this vulnerability and ensuring the continued security of user data and sessions. The incident highlights the ongoing challenges and importance of web application security, urging both developers and users to remain vigilant against emerging cybersecurity threats.