CAPEC-500
WebView Injection
An adversary, through a previously installed malicious application, injects code into the context of a web page displayed by a WebView component. Through the injected code, an adversary is able to manipulate the DOM tree and cookies of the page, expose sensitive information, and can launch attacks against the web application from within the web page.
On this page
Ask an AI about this attack pattern
Show the prompt
Explain the attack pattern CAPEC-500: WebView Injection: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/500.html and https://cve.bz/cve/capec/500?via=ask-ai-copy, which lists recent CVEs with the weaknesses it exploits. Cite the sources.Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this attack pattern's id and public links.
How the attack unfolds
Explore
The attacker looks for a way in.
[Determine target web application] An adversary first needs to determine what web application they wish to target.
2 techniques
- Target web applications that require users to enter sensitive information.
- Target web applications that an adversary wishes to operate on behalf of a logged in user.
Experiment
They probe what they found.
[Create malicious application] An adversary creates an application, often mobile, that incorporates a WebView component to display the targeted web application. This malicious application needs to downloaded by a user, so adversaries will make this application useful in some way.
2 techniques
- Create a 3rd party application that adds useful functionality to the targeted web application. Victims will download the application as a means of using the targeted web application.
- Create a fun game that at some point directs a user to the targeted web application. For example, prompt the user to buy in game currency by directing them to PayPal.
[Get the victim to download and run the application] An adversary needs to get the victim to willingly download and run the application.
2 techniques
- Pay for App Store advertisements
- Promote the application on social media, either through accounts made by the adversary or by paying for other accounts to advertise.
Exploit
They carry out the attack.
[Inject malicious code] Once the victim runs the malicious application and views the targeted web page in the WebView component, the malicious application will inject malicious JavaScript code into the web application. This is done by using WebView's loadURL() API, which can inject arbitrary JavaScript code into pages loaded by the WebView component with the same privileges. This is often done by adding a script tag to the document body with a src destination to a remote location that serves malicious JavaScript code.
3 techniques
- Execute operations on the targeted web page on behalf of an authenticated user.
- Steal cookie information from the victim.
- Add in extra fields to the DOM in an attempt to get a user to divulge sensitive information.
Prerequisites
An adversary must be able install a purpose built malicious application onto the device and convince the user to execute it. The malicious application is designed to target a specific web application and is used to load the target web pages via the WebView component. For example, an adversary may develop an application that interacts with Facebook via WebView and adds a new feature that a user desires. The user would install this 3rd party app instead of the Facebook app.
Mitigations
The only known mitigation to this type of attack is to keep the malicious application off the system. There is nothing that can be done to the target application to protect itself from a malicious application that has been installed and executed.
Weaknesses it exploits
- CWE-749 Exposed Dangerous Method or Function
- CWE-940 Improper Verification of Source of a Communication Channel
Recent CVEs with these weaknesses
- 9.3CVE-2026-138154
POSTAL 2 before build 26810491 contains a sandbox escape vulnerability that allows malicious Steam Workshop mods to execute code by calling ConsoleCommand with a start file URI. Attackers can ship a batch file in a mod at the predictable w…
- 7.7CVE-2026-138027
Bagel (bagel-mcp) before 2.5.5 exposes unsandboxed DuckDB SQL execution through the read-only annotated query_messages MCP tool, allowing file access and network requests. Attackers who prompt-inject the driving LLM via recorded logs or to…
- 4.2CVE-2026-102962
The MCUmgr SMP client matched an incoming response to a pending command in smp_client_response_discover() (subsys/mgmt/mcumgr/smp_client/src/client.c) using only the 8-bit sequence number and the operation. It did not check the transport t…
- 8.6CVE-2026-137551
Frappe Framework before 15.121.2 and 16.x before 16.36.0 exposes functions imported into module-path-hooked modules as Jinja globals, making them callable from sandboxed templates. Authenticated users who can author rendered templates, suc…
- 7.0CVE-2026-136429
PyTorch Foundation PyTorch PT2 File Parsing Exposed Dangerous Method Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of PyTorch Foundation PyTorch. User in…
- 4.8CVE-2026-102952
The Zephyr TFTP client in subsys/net/lib/tftp/tftp_client.c does not check where the reply to its request comes from. After sending a read or write request to the configured server, send_request() accepts the first UDP datagram that arrive…
- 8.8CVE-2026-86312
Under some configurations a request to the ping endpoint could carry out more than a simple health check. In deployments that rely on Solr's rule-based authorization, a client granted only the low-privilege health permission could thereby …
- 7.2CVE-2026-94562
NukeViet CMS is a multi Content Management System. Prior to 4.6.01, a super-administrator satisfying the NV_IS_SPADMIN gate can use modules/users/admin/fields.php to store an arbitrary existing PHP function in the func_callback setting for…
The newest records naming one of them. Each weakness's page lists them all.
Related attack patterns
- Part of
- CAPEC-253 Remote Code Inclusion
MITRE's words, unchanged: CAPEC-500 at MITRE. CAPEC is Copyright © 2007–2026, The MITRE Corporation, used under the CAPEC terms of use: “The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use Common Attack Pattern Enumeration and Classification (CAPEC™) for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE’s copyright designation and this license in any such copy.” CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. Credits. All attack patterns.