Telegram (v4.9.155353) was rendering file:// links + opening them via NSWorkspace.open -> code execution.
Telegram for macOS rendered file:// and custom URI scheme links from website previews and opened them via NSWorkspace.open, allowing an attacker to execute arbitrary executables or launch applications. The same issue existed on iOS, though impact there was possibly limited to URI schemes.
Published on github.com
In Telegram for macOS v4.9.155353 (and below) URL parsing logic in Telegram for macOS platform allows running arbitrary executables and applications URI schemes via links injected into the website's preview.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the app did not validate or restrict the URL schemes allowed in website previews before passing them to the operating system's open function.
Impact
The bug could disclose user machine details, run arbitrary executables, open arbitrary files, and launch applications via URI schemes; on iOS the impact was possibly limited to URI schemes.
What the attacker needed
Victim clicks a link in a chat; attacker controls a web page with a crafted preview
How it was found
- Send a link to an HTML file containing a meta tag with file:// and ssh:// URLs in the title.
- The website preview renders those URLs as clickable links.
- Clicking a file:// link that points to an executable runs it via NSWorkspace.open.
- Clicking an ssh:// link opens Terminal.app with an active SSH session, revealing the user's OS username and IP.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you share a link in a chat, Telegram shows a preview with a title and sometimes clickable links. The app treated special links starting with file:// or ssh:// as safe to open, so clicking one could run a program on your computer or start a terminal session. This is dangerous because a malicious link could run code without warning.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.