UPDATE Turns out Guillaume K. Ross also had related discoveries. Check out his presentation here. Follow him: @gepeto42
I spend my nights reading RFCs and pentesting various applications / services.
One night I was randomly reading the tel URI scheme RFC as I am fascinated by old relics that are still used today, their flaws and the way people never read the RFC which leads to RTFM pwnage as I call it.
As I finished reading the tel RFC I looked at my iPhone and said: Cool, let's try it out!. I instacoded a small html page and loaded it in Safari, here is the code:
As I clicked the click me link I was prompted with a nice dialog asking me if I really want to call 0000.
I didn't have much as this point and I was not looking for a security issue, just trying out the tel thing. As Apple likes to change stuff for no reason I thought: Hey, maybe Apple has its own RFC for tel!. And I was right: here it is.
Apple's documentation on the tel scheme is really short and easy to read. While reading the first paragraph something caught my attention:
So if I click the link in Safari I get the prompt asking me to confirm my action, if I click the link in a native app's webView it doesn't ask and performs the action right away (makes the call).
I instantly assumed people do read documentation so there was no way a big player like Facebook, Twitter, Google, LinkedIn, etc. would do such a silly mistake... but I was wrong.
I sent the page link through Facebook Messeger, clicked it to get to the webView (social apps don't want you to ever leave the app and that's why the use webViews) and then clicked the sneaky click me link:
So clicking on the link initiates the call right away. Hold on... that's bad.
Watch what happens:
Note: you can also do this server-side by redirecting the user to a tel location:
I can make you call a phone number by clicking a link in any app that didn't implement custom handling for tel links.
Imagine I register a premium-rate phone number and then I send you the link on Facebook Messenger or Twitter. You click it and call me, I pick up instantly and charge you.
I just made out the name for this attack, it's cool right? Facetime also had a URL scheme just like tel, and you can use it the same way. Needless to say it's vulnerable to the same exploit.
Facetime calls are instant. Imagine you clicking a link, your phone calls my (attacker) account, I instantly pick it up and (yes) save all the frames. Now I know how your face looks like and maybe where you are. Hello pretty!
Yes, it works. I tried.
Well Apple can't take all the blame. People didn't read the documentation at all. The first paragraph of the tel docs says what, when and how happens and also clearely specifies that
However, a native app can be configured to display its own alert.
However, Apple introduced a bad default as it's called (just like MongoDB which is by default remote accessible without any authentication).
While I only tested on a few apps which are big names, it is safe to assume that the smaller teams and platform haven't even thought about preventing this.