Masque Attack – every iOS app could be compromised

Researchers at FireEye identified a new attack dubbed the Masque, which allows attackers to replace a genuine app with a malicious one.

In these days Apple the community has discovered that is vulnerable to WireLurker, a new strain of malware that is able to infect Apple iPhone and iPad syphoning user’data.

The malware was discovered for the first time by experts at Palo Alto Networks that revealed it exhibited behavior that had never been seen before malware targeting Apple mobile devices, unfortunately, it has yet to be patched.

Meanwhile the security experts analyze the WireLurker case, the disclosure of a new attack in the wild exploiting a vulnerability dubbed the Masque is attracting the interest of the experts. Practically the exploitation of the Masque flaw allows bad actors to replace enterprise-signed apps, overwriting them with trojanized apps.

The Masque  vulnerability allows an attacker to swap out a legitimate iOS app with a malicious one, the attack scheme is effective against jailbroken and non-jailbroken devices.

Masque affects iOS 7.1.1, 7.1.2, 8.0, 8.1, and 8.1.1 beta, its attack schema is quite different from WireLurker that infects Apple mobile devices once connected via USB, but it can also be run remotely via an SMS or email message pointing a victim toward a malicious app.

Also in this case the problem seems to be caused by a poor implementation of an authentication process, the expert Tao Wei, a senior staff research scientist at FireEye, explained that Apple’s enterprise provisioning feature does not analyze digital certificates for apps given identical bundle identifiers.

The Enterprise provisioning service implemented by Apple allows enterprise iOS developers to develop and distribute iOS apps without having to upload the app to Apple.

“FireEye mobile security researchers have discovered that an iOS app installed using enterprise/ad-hoc provisioning could replace another genuine app installed through the App Store, as long as both apps used the same bundle identifier.”

“This vulnerability exists because iOS doesn’t enforce matching certificates for apps with the same bundle identifier,” Tao Wei said on the company’s blog post. “An attacker can leverage this vulnerability both through wireless networks and USB.” “iOS doesn’t check certificates during updating,” “Attackers can replace the old app with a fake app.” “Currently there is not MDM API to get the certificate information for each app,” Wei said. “Thus, it is difficult for the MDM to detect such attacks.”

Wei speaking about the WireLurker, explained that it is the unique case of attack up until now observed that is exploiting the Masque vulnerability. Let’s remind that the WireLurker malware in a first stage infects a host (desktop or laptop), which downloaded the malicious software from the web, then it waits for an Apple device (i.e. iPhone or iPad) to be connected via USB.

Once the Apple device is connected to the infected PC, WireLurker scans it analyzing the installed applications, then if a target app is present, it copies the app from the mobile device to the host, infects it and then install it again on the mobile unit.

The blog post published by FireEye also includes a demonstration of an attack, the experts have exploited the Masque replacing a valid Gmail app downloaded from the Apple App Store with a malicious version of the same app that is able to syphon the user’ messages. The attack starts with an SMS sent to the victims that invite it to download a new version of a legitimate app New Flappy Bird.

“In one of our experiments, we used an in-house app with a bundle identifier “com.google.Gmail” with a title “New Flappy Bird”. We signed this app using an enterprise certificate. When we installed this app from a website, it replaced the original Gmail app on the phone.” states the post. “By using the Masque attack, attackers can get all your existing sensitive data on your iPhone,” Wei added.

 

 

The attack is very dangerous, a bad actor would be able to mimic the original app to steal user’s credentials, the risk is serious if we think the possibility to compromise also signed banking apps. Experts at FireEye also explained that user’s data stored in the legitimate app’s directory, including local data caches, could be accessed by the malware.

“Masque Attacks can replace authentic apps,such as banking and email apps, using attacker’s malware through the Internet. That means the attacker can steal user’s banking credentials by replacing an authentic banking app with an malware that has identical UI. Surprisingly, the malware can even access the original app’s local data, which wasn’t removed when the original app was replaced. These data may contain cached emails, or even login-tokens which the malware can use to log into the user’s account directly.”

The principal problem for the security community is related to the simplicity in the exploitation of the Masque vulnerability.

 “It is a very powerful [vulnerability], but at the same time, it is very easy to exploit,” Wei said. “It can make the enterprise provisioning attack more powerful and more coverage over the victim. It’s easy to exploit and that’s why we are so concerned and why we think users should be warned.”

In order to avoid falling victim of a Masque Attack, it is suggested to adopt simply practices:
  • Do not download mobile apps clicking on a link received via email, text messages, or present on a web page.
  • Don’t install apps offered on pop-ups from third-party websites.
  • If the mobile device displays an alert about an “Untrusted App Developer,” click “Don’t Trust” on the alert and uninstall the application.

Pierluigi Paganini

(Security Affairs –  Masque, mobile)

Pierluigi Paganini

Pierluigi Paganini is member of the ENISA (European Union Agency for Network and Information Security) Threat Landscape Stakeholder Group and Cyber G7 Group, he is also a Security Evangelist, Security Analyst and Freelance Writer. Editor-in-Chief at "Cyber Defense Magazine", Pierluigi is a cyber security expert with over 20 years experience in the field, he is Certified Ethical Hacker at EC Council in London. The passion for writing and a strong belief that security is founded on sharing and awareness led Pierluigi to find the security blog "Security Affairs" recently named a Top National Security Resource for US. Pierluigi is a member of the "The Hacker News" team and he is a writer for some major publications in the field such as Cyber War Zone, ICTTF, Infosec Island, Infosec Institute, The Hacker News Magazine and for many other Security magazines. Author of the Books "The Deep Dark Web" and “Digital Virtual Currency and Bitcoin”.

Recent Posts

Security Affairs newsletter Round 526 by Pierluigi Paganini – INTERNATIONAL EDITION

A new round of the weekly Security Affairs newsletter has arrived! Every week, the best…

32 minutes ago

Two Linux flaws can lead to the disclosure of sensitive data

Qualys warns of two information disclosure flaws in apport and systemd-coredump, the core dump handlers in Ubuntu, Red Hat Enterprise…

18 hours ago

Meta stopped covert operations from Iran, China, and Romania spreading propaganda

Meta stopped three covert operations from Iran, China, and Romania using fake accounts to spread…

2 days ago

US Treasury sanctioned the firm Funnull Technology as major cyber scam facilitator

The U.S. sanctioned Funnull Technology and Liu Lizhi for aiding romance scams that caused major…

2 days ago

ConnectWise suffered a cyberattack carried out by a sophisticated nation state actor<gwmw style="display:none;"></gwmw><gwmw style="display:none;"></gwmw>

ConnectWise detected suspicious activity linked to a nation-state actor, impacting a small number of its…

2 days ago

Victoria’s Secret ‘s website offline following a cyberattack

Victoria’s Secret took its website offline after a cyberattack, with experts warning of rising threats…

3 days ago