---
title: "CAPEC-175: Code Inclusion"
url: https://radicalnotion.ai/capec/capec-175
type: capec
description: "An adversary exploits a weakness on the target to force arbitrary code to be retrieved locally or from a remote location and executed. This differs from code injection in that code injection involves the direct inclusion of code while code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application."
updated: 2026-06-01
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CAPEC-175: Code Inclusion

- **Abstraction:** Meta
- **Status:** Stable
- **Typical severity:** Very High
- **Likelihood of attack:** Medium
- **CAPEC catalog version:** 3.9

## Description

An adversary exploits a weakness on the target to force arbitrary code to be retrieved locally or from a remote location and executed. This differs from code injection in that code injection involves the direct inclusion of code while code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.

## Prerequisites

- The target application must include external code/libraries that are executed when the application runs and the adversary must be able to influence the specific files that get included.
- The victim must run the targeted application, possibly using the crafted parameters that the adversary uses to identify the code to include.

## Resources required

- The adversary may need the capability to host code modules if they wish their own code files to be included.

## Example instances

One example of this type of attack pattern is PHP file include attacks where the parameter of an include() function is set by a variable that an attacker is able to control. The result is that arbitrary code could be loaded into the PHP application and executed.

## Related weaknesses (CWE)

- [CWE-829](https://radicalnotion.ai/cwe/cwe-829): Inclusion of Functionality from Untrusted Control Sphere

## Related attack patterns

| Relationship | CAPEC | Name |
| --- | --- | --- |
| Child | [CAPEC-251](https://radicalnotion.ai/capec/capec-251) | Local Code Inclusion |
| Child | [CAPEC-253](https://radicalnotion.ai/capec/capec-253) | Remote Code Inclusion |
| Related | [CAPEC-234](https://radicalnotion.ai/capec/capec-234) | Hijacking a privileged process |

## Frequently asked questions

### What is CAPEC-175?

An adversary exploits a weakness on the target to force arbitrary code to be retrieved locally or from a remote location and executed. This differs from code injection in that code injection involves the direct inclusion of code while code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.

### What weaknesses does CAPEC-175 target?

CAPEC-175 exploits one CWE weakness: CWE-829 (Inclusion of Functionality from Untrusted Control Sphere).

### How severe is CAPEC-175?

MITRE rates CAPEC-175 as Very High severity with medium likelihood of attack.

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

---

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