Skip to content

fix(auth): mitigate tapjacking on the auth activity window#2416

Open
just1and0 wants to merge 2 commits into
version-10.0.0-beta04from
fix/2041-tapjacking-filter-touches
Open

fix(auth): mitigate tapjacking on the auth activity window#2416
just1and0 wants to merge 2 commits into
version-10.0.0-beta04from
fix/2041-tapjacking-filter-touches

Conversation

@just1and0

Copy link
Copy Markdown
Contributor

Summary

  • Adds window.decorView.filterTouchesWhenObscured = true in FirebaseAuthActivity.onCreate() to mitigate tapjacking/clickjacking attacks where an overlay intercepts user touches on the auth UI.
  • FirebaseAuthActivity is the only activity in the auth module (v10 is Compose-based), so this single-line change covers the entire auth flow.

Fixes #2041

Test plan

  • Launch the auth flow and verify touch input works normally without overlays
  • Verify that touches are ignored when another app draws an overlay on top of the auth UI

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates FirebaseAuthActivity by setting window.decorView.filterTouchesWhenObscured to true in onCreate. This is a security improvement to prevent tapjacking by filtering touch events when the window is obscured. There are no review comments, and I have no feedback to provide.

@demolaf demolaf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, the target branch should be version-10.0.0-beta04

Fixes #2041 by ignoring touches when the auth UI window is obscured by
another overlay, as recommended for overlay-based clickjacking attacks.
@just1and0
just1and0 changed the base branch from master to version-10.0.0-beta04 July 24, 2026 09:45
@just1and0
just1and0 force-pushed the fix/2041-tapjacking-filter-touches branch from 3f73e08 to f3ac23f Compare July 24, 2026 10:14

@russellwheatley russellwheatley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one 👍 One gap worth flagging on scope, plus a small test suggestion


override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
window.decorView.filterTouchesWhenObscured = true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This covers the activity's own window, but the Compose Dialogs in this module (e.g. ReauthenticationDialog for password re-entry) create their own separate native Window that this flag doesn't propagate to. Could you also set filterTouchesWhenObscured on those dialog windows, or note in the description that they're out of scope for this fix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 850d011 — added filterTouchesWhenObscured to both ReauthenticationDialog and ErrorRecoveryDialog via a SideEffect that sets the flag on the dialog's root view.


override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
window.decorView.filterTouchesWhenObscured = true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FirebaseAuthActivityTest.kt already has a Robolectric harness for this activity. Worth adding a small test asserting filterTouchesWhenObscured is true after onCreate so this can't silently regress.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 850d011 — new Robolectric test asserting filterTouchesWhenObscured is true on the activity window after onCreate.

- Set filterTouchesWhenObscured on dialog root views via SideEffect in
  ReauthenticationDialog and ErrorRecoveryDialog
- Add Robolectric test asserting the flag is set on the activity window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security issue with tapjacking

3 participants