---
title: "CAPEC-160: Exploit Script-Based APIs"
url: https://radicalnotion.ai/capec/capec-160
type: capec
description: "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."
updated: 2026-06-01
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CAPEC-160: Exploit Script-Based APIs

- **Abstraction:** Standard
- **Status:** Draft
- **Typical severity:** Medium
- **CAPEC catalog version:** 3.9

## Description

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.

## Execution flow

### Step 1: Explore

\[Identify API\] Discover an API of interest by exploring application documentation or observing responses to API calls

- Search via internet for known, published APIs that support scripting instructions as arguments

### Step 2: Experiment

\[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.

- Create a general script to be taken as input by the API

### Step 3: Exploit

\[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.

- 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.

## Related weaknesses (CWE)

- [CWE-346](https://radicalnotion.ai/cwe/cwe-346): Origin Validation Error

## Related attack patterns

| Relationship | CAPEC | Name |
| --- | --- | --- |
| Parent | [CAPEC-113](https://radicalnotion.ai/capec/capec-113) | Interface Manipulation |

## Frequently asked questions

### What is CAPEC-160?

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.

### How does a Exploit Script-Based APIs attack work?

It typically unfolds over 3 phases. It begins with: \[Identify API\] Discover an API of interest by exploring application documentation or observing responses to API calls

### What weaknesses does CAPEC-160 target?

CAPEC-160 exploits one CWE weakness: CWE-346 (Origin Validation Error).

### How severe is CAPEC-160?

MITRE rates CAPEC-160 as Medium severity.

Primary source: [MITRE CAPEC](https://capec.mitre.org/data/definitions/160.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/capec/capec-160). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
