CAPEC-160
Exploit Script-Based APIs
Some APIs support scripting instructions as arguments. Methods that take scripted instructions (or references to scripted instructions) can be very flexible and powerful. However, if an attacker can specify the script that serves as input to these methods they can gain access to a great deal of functionality. For example, HTML pages support <script> tags that allow scripting languages to be embedded in the page and then interpreted by the receiving web browser. If the content provider is malicious, these scripts can compromise the client application. Some applications may even execute the scripts under their own identity (rather than the identity of the user providing the script) which can allow attackers to perform activities that would otherwise be denied to them.
On this page
Ask an AI about this attack pattern
Show the prompt
Explain the attack pattern CAPEC-160: Exploit Script-Based APIs: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/160.html and https://cve.bz/cve/capec/160?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.
[Identify API] Discover an API of interest by exploring application documentation or observing responses to API calls
1 technique
- Search via internet for known, published APIs that support scripting instructions as arguments
Experiment
They probe what they found.
[Test simple script] Adversaries will attempt to give a smaller script as input to the API, such as simply printing to the console, to see if the attack is viable.
1 technique
- Create a general script to be taken as input by the API
Exploit
They carry out the attack.
[Give malicious scripting instructions to API] Adversaries will now craft custom scripts to do malicious behavior. Depending on the setup of the application this script could be run with user or admin level priveleges.
1 technique
- Crafting a malicious script to be run on a system based on priveleges and capabilities of the system
Prerequisites
The target application must include the use of APIs that execute scripts.
The target application must allow the attacker to provide some or all of the arguments to one of these script interpretation methods and must fail to adequately filter these arguments for dangerous or unwanted script commands.
Resources required
None: No specialized resources are required to execute this type of attack.
Weaknesses it exploits
- CWE-346 Origin Validation Error
Recent CVEs with these weaknesses
- 9.3CVE-2026-137189
Jupyter MCP Server is a Model Context Protocol server for Jupyter. Prior to 2.1.3, ManagementRouteSecurityMiddleware in jupyter_mcp_server/server.py checks request.url.hostname rather than the actual TCP peer before permitting access to /a…
- 7.5CVE-2026-102735
mcp-server-kubernetes is a Model Context Protocol server for Kubernetes cluster management. Prior to version 4.0.8, the SSE transport of mcp-server-kubernetes does not validate the Host header of incoming requests, which makes it vulnerabl…
- –CVE-2026-133636
Origin validation error vulnerability in Apache Struts. The Fetch Metadata Interceptor, which is part of the default interceptor stack, did not enforce its documented resource isolation policy: some cross-site requests that the policy reje…
- 7.7CVE-2026-136630
Electerm before 5.9.0 contains an origin validation vulnerability in the MCP Server widget that allows remote attackers to execute commands by bypassing Host and Origin checks through DNS rebinding. Attackers can lure users to a page that …
- 7.6CVE-2026-136628
Wails before 2.17.1 on Linux contains an origin validation error in the sendMessageToBackend WebKitGTK handler that allows child-frame scripts to invoke the privileged IPC channel. Attackers controlling content loaded in an iframe can post…
- 2.1CVE-2026-136147
A weakness has been identified in DWS Antik Browser 1.17.0. Affected by this issue is some unknown functionality of the file src/server/index.ts of the component Local API Server. Executing a manipulation can lead to origin validation erro…
- 8.7CVE-2026-136123
Friendica through 2026.05-1 contains an improper validation vulnerability in APContact::compactProfile() that allows remote actors to overwrite a local user's stored inbox and public key by declaring that user's profile URL as their actor …
- 6.3CVE-2026-135288
AIOStreams 2.9.0 through 2.38.1 contains an information disclosure vulnerability in makeRequest() that leaks the internal secret header by matching URLs against INTERNAL_URL using a string-prefix check. Attackers can supply a custom addon …
The newest records naming one of them. Each weakness's page lists them all.
Related attack patterns
- Part of
- CAPEC-113 Interface Manipulation
MITRE's words, unchanged: CAPEC-160 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.