Reflection Injection
Attack Pattern ID: 138 (Standard Attack Pattern Completeness: Stub)Typical Severity: Very HighStatus: Draft
+ Description

Summary

An attacker 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 attacker 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 attacker created. This can lead to the application revealing sensitive information, returning incorrect results, or even having the attacker take control of the targeted application.

+ Attack Prerequisites

The target application must utilize reflection libraries and allow users to directly control the parameters to these methods.

+ Resources Required

No special resources are required for most forms of this attack beyond the ability to provide input to the target that is used to populate parameters for reflection methods. If the attacker can host classes where the target can invoke them, more powerful variants of this attack are possible.

+ Related Attack Patterns
NatureTypeIDNameDescriptionView(s) this relationship pertains toView\(s\)
ChildOfCategoryCategory152Injection (Injecting Control Plane content through the Data Plane) 
Mechanism of Attack (primary)1000