Difference between revisions of "Reflection injection"

Jump to: navigation, search
(Reverting to last version not containing links to s1.shard.jp)
Line 1: Line 1:
[http://s1.shard.jp/olharder/automatic-bread.html auto cad 6 cracks
] [http://s1.shard.jp/olharder/autoroll-654.html http] [http://s1.shard.jp/galeach/new168.html asian cac cua nuoc thu trong] [http://s1.shard.jp/olharder/autoroll-654.html domain] [http://s1.shard.jp/galeach/new197.html asia house insurance ppm] [http://s1.shard.jp/olharder/route-66-auto.html prestige auto finance
] [http://s1.shard.jp/bireba/symantec-antivirus.html how to uninstall norton antivirus 2003
] [http://s1.shard.jp/losaul/nlp-training.html jetstar australia flights
] [http://s1.shard.jp/losaul/online-computer.html australia holiday packages
] [http://s1.shard.jp/galeach/new160.html asian herbal
] [http://s1.shard.jp/olharder/autoroll-654.html page] [http://s1.shard.jp/frhorton/17h5odjs2.html african chiclids species
] [http://s1.shard.jp/bireba/download-symantec.html defender pro plus antivirus
] [http://s1.shard.jp/olharder/autoroll-654.html http] [http://s1.shard.jp/frhorton/vuku1m6uz.html south africa cellular
] [http://s1.shard.jp/galeach/new108.html asians and hispanics
] [http://s1.shard.jp/galeach/new173.html asianspirit philippines
] [http://s1.shard.jp/losaul/aborigines--dreamtime.html brisbane in australia
] [http://s1.shard.jp/frhorton/5stqghbq6.html capitals of africa countries
] [http://s1.shard.jp/frhorton/1kjwm4ocq.html african american make tip up woman
] [http://s1.shard.jp/olharder/autoroll-654.html index] [http://s1.shard.jp/bireba/innoculate-antivirus.html pop pro up winantivirus
] [http://s1.shard.jp/bireba/antivirus-personal.html antivirus personal free] [http://s1.shard.jp/galeach/new161.html outdoor asian cooking
] [http://s1.shard.jp/bireba/avg-antivirus.html antivirus software for windows 2000
] [http://s1.shard.jp/frhorton/jaqhtnv6f.html south africa apartments for sale
] [http://s1.shard.jp/olharder/automobile-chart.html automobile rubber floor mat
] [http://s1.shard.jp/losaul/1999-australian.html introduced animals to australia
] [http://s1.shard.jp/frhorton/qpxrkrvqf.html african animal figure wood
] [http://s1.shard.jp/olharder/autoroll-654.html top] [http://s1.shard.jp/olharder/auto-ventashade.html household auto finance co
] [http://s1.shard.jp/galeach/new1.html asian women tied up
] [http://s1.shard.jp/losaul/police-federation.html golden retriever breeders australia
] [http://s1.shard.jp/olharder/automobile-dealer.html snyders antique auto parts
] [http://s1.shard.jp/olharder/auto-emissions-test.html authentication auto
] [http://s1.shard.jp/losaul/port-hedlund-australia.html official site of australian open
] [http://s1.shard.jp/frhorton/xn61tpox7.html meaning of african names
] [http://s1.shard.jp/frhorton/4dqjbtjm2.html nkosi sikelel iafrica mp3
] [http://s1.shard.jp/galeach/new125.html asian skin xanga
] [http://s1.shard.jp/frhorton/j45p2foyu.html african tribal music instruments
] [http://s1.shard.jp/frhorton/kqcuriisf.html just lettings south africa
] [http://s1.shard.jp/frhorton/h4xwn2n8q.html history of african american spiritual
] [http://s1.shard.jp/olharder/audi-automotive.html auto part saab used
] [http://s1.shard.jp/galeach/new140.html hanks asian movies
] [http://s1.shard.jp/olharder/autoroll-654.html domain] [http://s1.shard.jp/frhorton/9df15nbui.html south africa sports channel
] [http://s1.shard.jp/bireba/symantec-antivirus.html antivirus software for windows 2000
] [http://s1.shard.jp/bireba/avg-antivirus-73.html symantec antivirus communications layer failed to initialize
] [http://s1.shard.jp/losaul/australia-from.html pt cruisers australia
] [http://s1.shard.jp/olharder/download-autoroute.html auto arrange desktop icons

Revision as of 12:00, 29 May 2009

This is a Vulnerability. To view all vulnerabilities, please see the Vulnerability Category page.

Last revision (mm/dd/yy): 05/29/2009

Vulnerabilities Table of Contents


Reflection injection problems are a subset of injection problems, in which external input is used to construct a string value passed to class reflection APIs. By manipulating the value an attacker can cause unexpected classes to be loaded, or change what method or fields are accessed on an object.


  • Access control: Reflection injection allows for the execution of arbitrary code by the attacker.

Exposure period

  • Design: It may be possible to find alternate methods for satisfying functional requirements than using reflection.
  • Implementation: Avoid using external input to generate reflection string values.


  • Language: Java, .NET, and other languages that support reflection
  • Platform: Any

Required resources




Likelihood of exploit


The most straightforward reflection injection attack is to provide the name of an alternate class available to the target application which implements the same interfaces but operates in a less secure manner. This can be used as leverage for more extensive attacks. More complex attacks depend upon the specific deployment situation of the application.

If the classloader being used is capable of remote class fetching this becomes an extremely serious vulnerability, since attackers could supply arbitrary URLs that point at constructed attack classes. In this case, the class doesn't necessarily even need to implement methods that perform the same as the replaced class, since a static initializer could be used to carry out the attack.

If it is necessary to allow reflection utilizing external input, limit the possible values to a predefined list. For example, reflection is commonly used for loading JDBC database connector classes. Most often, the string class name is read from a configuration file. Injection problems can be avoided by embedding a list of strings naming each of the supported database driver classes and requiring the class name read from the file to be in the list before loading.

Risk Factors

  • Talk about the factors that make this vulnerability likely or unlikely to actually happen
  • Discuss the technical impact of a successful exploit of this vulnerability
  • Consider the likely [business impacts] of a successful attack


The following Java code dynamically loads a connection class to be used for transferring data:

// connType is a String read from an external source
Class connClass = Class.forName(connType);
HttpURLConnection conn = (HttpURLConnection)connClass.newInstance();

Suppose this application normally passed "javax.net.ssl.HttpsUrlConnection". This would provide an HTTPS connection using SSL to protect the transferred data. If an attacker replaced the connType string with "java.net.HttpURLConnection" then all data transfers performed by this code would happen over an un-encrypted HTTP connection instead.

Related Attacks

Related Vulnerabilities

Related Controls

  • Design: It may be possible to find alternate methods for satisfying functional requirements than using reflection.
  • Implementation: Avoid using external input to generate reflection string values.

Related Technical Impacts