Archive

Posts Tagged ‘Mobile’

How to takeover a webview in a mobile app

July 3, 2026 Leave a comment

Mobile WebViews: The Silent Gateways to Account Takeover

Mobile webviews have become a critical component in modern applications, yet they present a surprisingly stealthy attack surface that developers often overlook. These components, which render web content within native mobile apps, are vulnerable to a range of security flaws that can lead to severe consequences including account takeovers and data breaches. Understanding these vulnerabilities is essential for building applications that protect user privacy and security in an increasingly connected digital landscape.

The Anatomy of a Classic Exploit: CVE-2018-6495

CVE-2018-6495 represents a cross-origin storage vulnerability in Android’s WebView implementation that allows high-permission applications to leak sensitive cookies to lower-permission content loaded within the same WebView control. This flaw enables attackers to exfiltrate credentials stored by applications with elevated permissions through a mechanism that bypasses typical security boundaries between different app components. The vulnerability exploits how Android WebView handles cross-origin storage by allowing cookies from one app to be accessed by another app with lower privileges, creating a direct path for privilege escalation attacks.

Attackers leverage this weakness to extract sensitive information such as authentication tokens and session cookies from applications that users trust. When malicious content is loaded within the WebView, it can intercept and steal credentials without requiring any user interaction beyond opening the app. This makes CVE-2018-6495 particularly dangerous because it operates through the app’s own WebView infrastructure, meaning users often remain unaware of the breach until their accounts are compromised.

Why iOS WKWebView Isn’t Immune to These Flaws

iOS WKWebView implements additional security measures compared to Android’s WebView, yet it remains vulnerable through misconfiguration and insufficient permission controls. These protections are designed to mitigate cross-origin storage leaks but can be circumvented when developers fail to properly isolate WebView content from other app components. The risk increases significantly when apps store sensitive credentials without adequate security attributes like SameSite cookies or strict CORS policies.

Apple’s security framework includes features to prevent unauthorized data access across origins, but these safeguards are only effective when implemented correctly. Developers often overlook critical configuration steps that could expose their apps to similar vulnerabilities as the Android case. When WebView components are misconfigured, attackers can still exploit same-origin storage leaks to steal session tokens and credentials from legitimate user sessions.

The Account Takeover Attack: When Phishing Meets WebView

Account takeover attacks frequently occur when malicious URL redirections within app-controlled WebView controls redirect users to credential-harvesting phishing pages disguised as legitimate app interfaces. These attacks exploit the trust users have in their own applications by manipulating WebView navigation to present fraudulent login forms that mimic the original app’s design. The attacker then captures credentials through deceptive interfaces that appear to be part of the user’s trusted application environment.

The process typically begins with a user visiting a seemingly safe website within the app’s WebView, followed by a redirection to a malicious endpoint that harvests login credentials. Attackers often use social engineering tactics to trick users into believing they are interacting with their own app, making the phishing attempt appear legitimate. This approach is especially effective because it bypasses traditional browser-based security mechanisms that would otherwise block such redirects.

Protecting Your App: Critical Steps for Secure WebView Implementation

Developers must implement strict permission controls to prevent high-permission apps from leaking cookies to lower-permission content loaded within the same WebView. This includes using secure storage mechanisms and avoiding cross-origin storage without explicit user consent. Additionally, applications should enforce proper CORS configurations to limit how web content can interact with sensitive resources.

Another critical step involves validating all WebView navigation to prevent unauthorized redirects to phishing pages. Implementing SameSite attributes for cookies ensures that session tokens are not sent with requests across different origins, reducing the risk of credential theft. Regular security audits of WebView configurations are essential to identify and fix vulnerabilities before attackers exploit them.

Finally, developers should prioritize user education about app security by clearly communicating when WebView content is being redirected and providing options to block suspicious activity. This proactive approach helps users recognize potential threats before they lead to account compromise. The combination of technical safeguards and user awareness creates a robust defense against WebView-based attacks.

Mobile webviews remain a critical security consideration despite their widespread use. By understanding the underlying vulnerabilities and implementing robust mitigation strategies, developers can significantly reduce the risk of account takeovers and data breaches. The key lies in treating WebView components as a security boundary rather than a passive rendering layer, ensuring that applications maintain the trust users expect from their digital experiences.

New European rules for mobile banking apps coming to a device near you…

July 26, 2019 Leave a comment

The world is clearly a better place now that we carry computers in our back pocket but we need an increase in security measures for payment transactions and therefore we will require an increase in regulation, such as the PSD2 from European Commission.

The Payment Services Directive mandates compliance by September 2019 and aims to regulate banks, payment service providers and electronic payments to include security features to protect consumers across digital channels. The PSD2 legislation will require financial services in the European Union (EU) to contribute to a more integrated, secure, and efficient payments ecosystem.

The PSD2 directive requires financial institutions to:

  • Provide/Implement a monitoring mechanism in their apps to detect/report signs of malware.
  • Provide security measures in their app to mitigate risk for the user device.
  • Ensure consumers have a secure environment to execute their financial transactions

In Article 2 and Article 9 of the directive, PSD2 highlights Strong Customer Authentication (SCA) and Safe Execution Environment (SEE), which requires de-risking across various threat vectors impacting mobile apps.

These include detecting compromised devices (eg: jailbroken or rooted), unsafe environments (such as a fake or malicious wi-fi), as well as malware and vulnerabilities within the application execution environment. PSD2 also includes RTS (Regulatory Technical Standards), which are regulatory requirements set by the European Banking Authority (EBA) to ensure that payments across the EU are secure, fair & efficient.

To meet these requirements, financial institutions should add strong security capabilities like binary protections to their mobile apps. These controls are designed to protect against known and unknown threats on users’ devices.

Mobile banking apps should also be able to detect when they are installed on risky devices and consider restricting access to high value banking services until those risks have been remediated.

Categories: Mobile, security Tags: ,