Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sun, 28 Apr 2024 17:59:34 +0200
From: Pedro Batista <>
Subject: Telegram Web app XSS / Session Hijacking 1-click

Hi oss-security,
I would like to share a vulnerability I reported on Telegram Web
application which is Open Source (
The vulnerability is a XSS that can be exploited to achieve session
hijacking with 1-click using Telegram Mini Apps.

I reported the vulnerability on March 9th, 2024 and Telegram promptly fixed
it on March 11th, 2024.

# Vulnerable version: Telegram WebK 2.0.0 (486) and below
# Fixed version: Telegram WebK 2.0.0 (488)

# Attack Surface
## Telegram Mini Apps
“Telegram Mini Apps are essentially web applications that you can run
directly within the Telegram messenger interface. Mini Apps support
seamless authorization, integrated crypto and fiat payments (via Google Pay
and Apple Pay), tailored push notifications, and more.”


Is important to highlight that this feature is heavily used for crypto
payments in the TON Blockchain.

# Static Analysis
A cached version of the vulnerable file can be found here:

       // [...]
The vulnerability was triggered with `postMessage` communication by abusing
the event `web_app_open_link` which allowed a new URL to remain with the
javascript context of the parent window using the `javascript:` scheme as
XSS payload.

# Weaponized Setup
1. Attacker creates a Bot + Mini App
2. Sets the URL of the Mini App =>
3. The exploit will be hosted in the homepage of the attacker’s site
3.1. homepage.html
<body onload=exploit()>
function exploit() {
 window.parent.postMessage(JSON.stringify({eventType: 'web_app_open_link',
eventData: {url:
"javascript:alert(JSON.stringify(window.parent.localStorage))"}}), '*'); }

# Telegram Patch Commit

export default function
safeWindowOpen(url: string) {, '_blank', 'noreferrer');

# Demo
I have published a writeup for this finding which includes the Exploit
Demo, it's available here:

I recently requested a CVE for this vulnerability as well, looking forward
to updating the thread as soon as it is issued.

Thanks for looking into my report.

Best regards,
Pedro Baptista

Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.