---
title: "CAPEC-138: Reflection Injection"
url: https://radicalnotion.ai/capec/capec-138
type: capec
description: "An adversary supplies a value to the target application which is then used by reflection methods to identify a class, method, or field. For example, in the Java programming language the reflection libraries permit an application to inspect, load, and invoke classes and their components by name. If an adversary can control the input into these methods including the name of the class/method/field or the parameters passed to methods, they can cause the targeted application to invoke incorrect methods, read random fields, or even to load and utilize malicious classes that the adversary created. This can lead to the application revealing sensitive information, returning incorrect results, or even having the adversary take control of the targeted application."
updated: 2026-06-01
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CAPEC-138: Reflection Injection

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

## Description

An adversary supplies a value to the target application which is then used by reflection methods to identify a class, method, or field. For example, in the Java programming language the reflection libraries permit an application to inspect, load, and invoke classes and their components by name. If an adversary can control the input into these methods including the name of the class/method/field or the parameters passed to methods, they can cause the targeted application to invoke incorrect methods, read random fields, or even to load and utilize malicious classes that the adversary created. This can lead to the application revealing sensitive information, returning incorrect results, or even having the adversary take control of the targeted application.

## Prerequisites

- The target application must utilize reflection libraries and allow users to directly control the parameters to these methods. If the adversary can host classes where the target can invoke them, more powerful variants of this attack are possible.
- The target application must accept a string as user input, fail to sanitize characters that have a special meaning in the parameter encoding, and insert the user-supplied string in an encoding which is then processed.

## Resources required

- None: No specialized resources are required to execute this type of attack.

## Related weaknesses (CWE)

- [CWE-470](https://radicalnotion.ai/cwe/cwe-470): Use of Externally-Controlled Input to Select Classes or Code

## Related attack patterns

| Relationship | CAPEC | Name |
| --- | --- | --- |
| Parent | [CAPEC-137](https://radicalnotion.ai/capec/capec-137) | Parameter Injection |

## Frequently asked questions

### What is CAPEC-138?

An adversary supplies a value to the target application which is then used by reflection methods to identify a class, method, or field. For example, in the Java programming language the reflection libraries permit an application to inspect, load, and invoke classes and their components by name. If an adversary can control the input into these methods including the name of the class/method/field or the parameters passed to methods, they can cause the targeted application to invoke incorrect methods, read random fields, or even to load and utilize malicious classes that the adversary created. This can lead to the application revealing sensitive information, returning incorrect results, or even having the adversary take control of the targeted application.

### What weaknesses does CAPEC-138 target?

CAPEC-138 exploits one CWE weakness: CWE-470 (Use of Externally-Controlled Input to Select Classes or Code).

### How severe is CAPEC-138?

MITRE rates CAPEC-138 as Very High severity.

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

---

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