Tapjacking

Sensitive controls accept touches while another app's window covers them, so a malicious overlay can trick the user into tapping them unknowingly.

SeverityLow
CVSS 3.13.3 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N Open in the calculator
CVSS 4.04.6 CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-1021: Improper Restriction of Rendered UI Layers or Frames
OWASP Top 10A06:2025 Insecure Design
CategoryInput Validation

Description

Tapjacking is an Android user interface attack, comparable to clickjacking on the web. A malicious application that the user has been persuaded to install, and in most cases to grant permission to display over other applications, draws a window over the target application. The overlay shows misleading content but lets the user's taps pass through to the target's controls beneath it, or covers only part of the screen so that the user taps an exposed control without understanding what it does. The user believes they are interacting with the harmless content, but their taps perform actions in the target application that they did not intend, such as approving a payment or a request, granting a permission or changing a setting.

The application is affected when its sensitive views accept touches while their window is wholly or partly obscured by another application's window. Android 12 and later block touches that pass through most opaque overlays from other applications, which reduces the risk on current devices, but touches through sufficiently translucent overlays, and touches beside an overlay that covers only part of the screen, are still delivered, and older versions lack this protection. Because the attack cannot read data directly, needs the user's interaction at the right moment and is largely limited by these protections, the risk is low, though it is higher for applications in which a single tap completes a high-value action.

The weakness is identified by reviewing layouts and code for filterTouchesWhenObscured or for checks on the obscured flags of touch events, and confirmed with a proof-of-concept overlay application on a device running an affected Android version. iOS does not allow applications to draw over other applications, so the finding applies to Android.

Remediation

Discard touches on sensitive controls whenever another window covers them:

  • Set android:filterTouchesWhenObscured="true" on views that confirm sensitive actions, or on the root layout of sensitive screens, or call setFilterTouchesWhenObscured(true) in code.
  • Because that setting does not cover a partial overlay that leaves the touched point uncovered, also reject touch events that carry FLAG_WINDOW_IS_PARTIALLY_OBSCURED (Android 10 and later) as well as FLAG_WINDOW_IS_OBSCURED on the most sensitive controls.
  • On Android 12 and later, call setHideOverlayWindows(true) on the window of the most sensitive screens, declaring the HIDE_OVERLAY_WINDOWS permission, to hide other applications' overlays while the screen is shown.
  • Require an explicit confirmation step with re-authentication for high-value actions, so that a single misdirected tap cannot complete them.
// Kotlin, in a custom view that guards a sensitive control override fun onFilterTouchEventForSecurity(event: MotionEvent): Boolean { val obscured = MotionEvent.FLAG_WINDOW_IS_OBSCURED or MotionEvent.FLAG_WINDOW_IS_PARTIALLY_OBSCURED if ((event.flags and obscured) != 0) return false return super.onFilterTouchEventForSecurity(event) }

Confirm the fix with an overlay test application on the oldest Android version the application supports, checking that taps through or beside the overlay are ignored.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Mobile Applications Findings

Every Mobile Applications finding