My presentation from the Android Budapest April 2024 meetup about the insecurity you may feel due to unsecure WebViews.
See an upgraded version of this presentation: https://speakerdeck.com/balazsgerlei/droidcon-london-2024
Intro
Is your relationship with WebViews healthy? Sometimes you just can't avoid the need to display web content in your app. It can be a functionality that you need to push out quickly and it's already implemented by web developers in your team, or just a Terms and conditions page that you have to display in your app while it also needs to be updateable without going through a release cycle.
Either way, web content tends to make way into many apps and it's not trivial that with just adding a single WebView, how much you can open up your app for abuse by malicious actors. Google made steady progress in making WebViews more secure but in most cases you can't stop supporting those old, vulnerable Android versions and then it's your responsibility to secure your WebViews. This talk aims to help with that while also highlighting security issues that lurk in those seemingly simple yet quite complex APIs.
Links
Modern WebView best practices (Android Dev Summit ‘18)
https://youtu.be/HGZYtDZhOEQ
Android Security Evolution
https://balazsgerlei.com/AndroidSecurityEvolution
Executing JavaScript and WebAssembly
https://developer.android.com/develop/ui/views/layout/webapps/jsengine
Overview of Android Custom Tabs
https://developer.chrome.com/docs/android/custom-tabs/
HackTricks - Webview Attacks
https://book.hacktricks.xyz/mobile-pentesting/android-app-pentesting/webview-attacks
And finally my freshly released SecureWebView library:
https://github.com/balazsgerlei/SecureWebView