Most of the Android devices (running Lolipop, Marshmallow, and Nougat) are exposed to an attack that exploits the MediaProjection service to capture the user’s screen and record system audio. By exploiting this issue, the attacker can simply fool a user into giving the proper rights to a malicious app.
Google launched the MediaProjection service to the Android Framework in Android 5.0 to give developers the capability to capture screen contents and record system audio. Before Android 5.0, developers required their apps to run with root privileges in order to use system protected permissions to get screen contents.
A report by MWR Labs describes:
To use the MediaProjection service, an application would simply have to request access to this system Service via an Intent. Access to this system Service is granted by displaying a SystemUI pop-up that warns the user that the requesting application would like to capture the user’s screen.
The main issue with MediaProjection service is that it is not reliant on permission, which makes it difficult to discover if an application is going to make use of the service.
This issue has been fixed in Android 8 Oreo only, users running Lollipop, Marshmallow or Nougat remain at risk. The only true fix at the moment is to upgrade to Oreo.