Secure coding technique: Let's talk about Tapjacking
Tapjacking, a combination of "tap" and "hijacking", means just that. It is an attack where the attacker hijacks the users taps and tricks him into doing something he did not intend. So how does it work and how do we prevent it?
Well start our story with screen overlays. Screen overlays or as Google calls them, windows using the type TYPE_APPLICATION_OVERLAY. These are windows that are drawn on top of other apps and usually only obscure a part of the screen. These are often used (like the example image below) when an app requests new permissions.
This is actually a cool and fun feature and more and more apps are starting to use it, think about Facebooks chat bubbles, or Google Maps navigation in a corner of your screen, like the screenshot below.
However, there are some security risks involved with these overlays. Any active screen overlay can listen for taps, how else would Facebook know that we tapped or dragged the bubble? This allows apps to spy on you and potentially steal passwords and credit card data.
One step further, and this is where the term tapjacking comes from, overlays can draw things on top of other apps tricking the user to perform different actions. The user thinks he is interacting with the overlay but in reality, his taps also perform actions in the underlying app. This way, the overlay can trick you into enabling certain permissions, or change some dangerous settings, as demonstrated in this old YouTube video.
The demonstration video above was uploaded to YouTube in 2010, so it was done on an older version of Android. But the attack is still relevant today, as vulnerabilities came to light that allows tapjacking in newer versions of Android such as Nougat and Marshmallow.
So what can you do about it? As a user, it is important to realize the consequences of these overlays and be aware of apps that use it. As of API level 23 (Android 6.0 Marshmallow), this has become a permission that has to be explicitly granted by the user. However, that leaves 50% of Androidusers still vulnerable. You can still check what apps make use of this permission in the settings under "Display over other apps".
As developers, it is up to us to make sure user actions are done with the full knowledge and consent of the user. Android provides a setting for your views that do just that, called filterTouchesWhenObscured. When it is enabled, the framework will discard touches that are received whenever the views window is obscured by another visible window. Its as simple as that, set filterTouchesWhenObscured to true, and your app is safe from tapjacking.
Good luck and see you next week!
Sometimes it is essential that an application be able to verify that an action is being performed with the full knowledge and consent of the user, such as granting a permission request, making a purchase or clicking on an advertisement. Unfortunately, a malicious application could try to spoof the user into performing these actions, unaware, by concealing the intended purpose of the view.
https://developer.android.com/reference/android/view/View.html
Sometimes it is essential that an application be able to verify that an action is being performed with the full knowledge and consent of the user
Application Security Researcher - R&D Engineer - PhD Candidate
Secure Code Warrior is here for your organization to help you secure code across the entire software development lifecycle and create a culture in which cybersecurity is top of mind. Whether you’re an AppSec Manager, Developer, CISO, or anyone involved in security, we can help your organization reduce risks associated with insecure code.
Book a demoApplication Security Researcher - R&D Engineer - PhD Candidate
Tapjacking, a combination of "tap" and "hijacking", means just that. It is an attack where the attacker hijacks the users taps and tricks him into doing something he did not intend. So how does it work and how do we prevent it?
Well start our story with screen overlays. Screen overlays or as Google calls them, windows using the type TYPE_APPLICATION_OVERLAY. These are windows that are drawn on top of other apps and usually only obscure a part of the screen. These are often used (like the example image below) when an app requests new permissions.
This is actually a cool and fun feature and more and more apps are starting to use it, think about Facebooks chat bubbles, or Google Maps navigation in a corner of your screen, like the screenshot below.
However, there are some security risks involved with these overlays. Any active screen overlay can listen for taps, how else would Facebook know that we tapped or dragged the bubble? This allows apps to spy on you and potentially steal passwords and credit card data.
One step further, and this is where the term tapjacking comes from, overlays can draw things on top of other apps tricking the user to perform different actions. The user thinks he is interacting with the overlay but in reality, his taps also perform actions in the underlying app. This way, the overlay can trick you into enabling certain permissions, or change some dangerous settings, as demonstrated in this old YouTube video.
The demonstration video above was uploaded to YouTube in 2010, so it was done on an older version of Android. But the attack is still relevant today, as vulnerabilities came to light that allows tapjacking in newer versions of Android such as Nougat and Marshmallow.
So what can you do about it? As a user, it is important to realize the consequences of these overlays and be aware of apps that use it. As of API level 23 (Android 6.0 Marshmallow), this has become a permission that has to be explicitly granted by the user. However, that leaves 50% of Androidusers still vulnerable. You can still check what apps make use of this permission in the settings under "Display over other apps".
As developers, it is up to us to make sure user actions are done with the full knowledge and consent of the user. Android provides a setting for your views that do just that, called filterTouchesWhenObscured. When it is enabled, the framework will discard touches that are received whenever the views window is obscured by another visible window. Its as simple as that, set filterTouchesWhenObscured to true, and your app is safe from tapjacking.
Good luck and see you next week!
Sometimes it is essential that an application be able to verify that an action is being performed with the full knowledge and consent of the user, such as granting a permission request, making a purchase or clicking on an advertisement. Unfortunately, a malicious application could try to spoof the user into performing these actions, unaware, by concealing the intended purpose of the view.
https://developer.android.com/reference/android/view/View.html
Tapjacking, a combination of "tap" and "hijacking", means just that. It is an attack where the attacker hijacks the users taps and tricks him into doing something he did not intend. So how does it work and how do we prevent it?
Well start our story with screen overlays. Screen overlays or as Google calls them, windows using the type TYPE_APPLICATION_OVERLAY. These are windows that are drawn on top of other apps and usually only obscure a part of the screen. These are often used (like the example image below) when an app requests new permissions.
This is actually a cool and fun feature and more and more apps are starting to use it, think about Facebooks chat bubbles, or Google Maps navigation in a corner of your screen, like the screenshot below.
However, there are some security risks involved with these overlays. Any active screen overlay can listen for taps, how else would Facebook know that we tapped or dragged the bubble? This allows apps to spy on you and potentially steal passwords and credit card data.
One step further, and this is where the term tapjacking comes from, overlays can draw things on top of other apps tricking the user to perform different actions. The user thinks he is interacting with the overlay but in reality, his taps also perform actions in the underlying app. This way, the overlay can trick you into enabling certain permissions, or change some dangerous settings, as demonstrated in this old YouTube video.
The demonstration video above was uploaded to YouTube in 2010, so it was done on an older version of Android. But the attack is still relevant today, as vulnerabilities came to light that allows tapjacking in newer versions of Android such as Nougat and Marshmallow.
So what can you do about it? As a user, it is important to realize the consequences of these overlays and be aware of apps that use it. As of API level 23 (Android 6.0 Marshmallow), this has become a permission that has to be explicitly granted by the user. However, that leaves 50% of Androidusers still vulnerable. You can still check what apps make use of this permission in the settings under "Display over other apps".
As developers, it is up to us to make sure user actions are done with the full knowledge and consent of the user. Android provides a setting for your views that do just that, called filterTouchesWhenObscured. When it is enabled, the framework will discard touches that are received whenever the views window is obscured by another visible window. Its as simple as that, set filterTouchesWhenObscured to true, and your app is safe from tapjacking.
Good luck and see you next week!
Sometimes it is essential that an application be able to verify that an action is being performed with the full knowledge and consent of the user, such as granting a permission request, making a purchase or clicking on an advertisement. Unfortunately, a malicious application could try to spoof the user into performing these actions, unaware, by concealing the intended purpose of the view.
https://developer.android.com/reference/android/view/View.html
Click on the link below and download the PDF of this resource.
Secure Code Warrior is here for your organization to help you secure code across the entire software development lifecycle and create a culture in which cybersecurity is top of mind. Whether you’re an AppSec Manager, Developer, CISO, or anyone involved in security, we can help your organization reduce risks associated with insecure code.
View reportBook a demoApplication Security Researcher - R&D Engineer - PhD Candidate
Tapjacking, a combination of "tap" and "hijacking", means just that. It is an attack where the attacker hijacks the users taps and tricks him into doing something he did not intend. So how does it work and how do we prevent it?
Well start our story with screen overlays. Screen overlays or as Google calls them, windows using the type TYPE_APPLICATION_OVERLAY. These are windows that are drawn on top of other apps and usually only obscure a part of the screen. These are often used (like the example image below) when an app requests new permissions.
This is actually a cool and fun feature and more and more apps are starting to use it, think about Facebooks chat bubbles, or Google Maps navigation in a corner of your screen, like the screenshot below.
However, there are some security risks involved with these overlays. Any active screen overlay can listen for taps, how else would Facebook know that we tapped or dragged the bubble? This allows apps to spy on you and potentially steal passwords and credit card data.
One step further, and this is where the term tapjacking comes from, overlays can draw things on top of other apps tricking the user to perform different actions. The user thinks he is interacting with the overlay but in reality, his taps also perform actions in the underlying app. This way, the overlay can trick you into enabling certain permissions, or change some dangerous settings, as demonstrated in this old YouTube video.
The demonstration video above was uploaded to YouTube in 2010, so it was done on an older version of Android. But the attack is still relevant today, as vulnerabilities came to light that allows tapjacking in newer versions of Android such as Nougat and Marshmallow.
So what can you do about it? As a user, it is important to realize the consequences of these overlays and be aware of apps that use it. As of API level 23 (Android 6.0 Marshmallow), this has become a permission that has to be explicitly granted by the user. However, that leaves 50% of Androidusers still vulnerable. You can still check what apps make use of this permission in the settings under "Display over other apps".
As developers, it is up to us to make sure user actions are done with the full knowledge and consent of the user. Android provides a setting for your views that do just that, called filterTouchesWhenObscured. When it is enabled, the framework will discard touches that are received whenever the views window is obscured by another visible window. Its as simple as that, set filterTouchesWhenObscured to true, and your app is safe from tapjacking.
Good luck and see you next week!
Sometimes it is essential that an application be able to verify that an action is being performed with the full knowledge and consent of the user, such as granting a permission request, making a purchase or clicking on an advertisement. Unfortunately, a malicious application could try to spoof the user into performing these actions, unaware, by concealing the intended purpose of the view.
https://developer.android.com/reference/android/view/View.html
Table of contents
Application Security Researcher - R&D Engineer - PhD Candidate
Secure Code Warrior is here for your organization to help you secure code across the entire software development lifecycle and create a culture in which cybersecurity is top of mind. Whether you’re an AppSec Manager, Developer, CISO, or anyone involved in security, we can help your organization reduce risks associated with insecure code.
Book a demoDownloadResources to get you started
Benchmarking Security Skills: Streamlining Secure-by-Design in the Enterprise
The Secure-by-Design movement is the future of secure software development. Learn about the key elements companies need to keep in mind when they think about a Secure-by-Design initiative.
DigitalOcean Decreases Security Debt with Secure Code Warrior
DigitalOcean's use of Secure Code Warrior training has significantly reduced security debt, allowing teams to focus more on innovation and productivity. The improved security has strengthened their product quality and competitive edge. Looking ahead, the SCW Trust Score will help them further enhance security practices and continue driving innovation.
Resources to get you started
Trust Score Reveals the Value of Secure-by-Design Upskilling Initiatives
Our research has shown that secure code training works. Trust Score, using an algorithm drawing on more than 20 million learning data points from work by more than 250,000 learners at over 600 organizations, reveals its effectiveness in driving down vulnerabilities and how to make the initiative even more effective.
Reactive Versus Preventive Security: Prevention Is a Better Cure
The idea of bringing preventive security to legacy code and systems at the same time as newer applications can seem daunting, but a Secure-by-Design approach, enforced by upskilling developers, can apply security best practices to those systems. It’s the best chance many organizations have of improving their security postures.
The Benefits of Benchmarking Security Skills for Developers
The growing focus on secure code and Secure-by-Design principles requires developers to be trained in cybersecurity from the start of the SDLC, with tools like Secure Code Warrior’s Trust Score helping measure and improve their progress.
Driving Meaningful Success for Enterprise Secure-by-Design Initiatives
Our latest research paper, Benchmarking Security Skills: Streamlining Secure-by-Design in the Enterprise is the result of deep analysis of real Secure-by-Design initiatives at the enterprise level, and deriving best practice approaches based on data-driven findings.