3
3
"qhelp.dtd">
4
4
<qhelp >
5
5
<overview >
6
- <p >Object-Graph Navigation Language (OGNL) is an open-source Expression Language (EL) for Java. Due
7
- to its ability to create or change executable code, OGNL is capable of introducing critical
8
- security flaws to any application that uses it. Evaluation of unvalidated expressions can let
9
- attacker to modify Java objects' properties or execute arbitrary code.</p >
6
+ <p >Object-Graph Navigation Language (OGNL) is an open-source Expression Language (EL) for Java.
7
+ OGNL can create or change executable code, consequently it can introduce critical
8
+ security flaws to any application that uses it. Evaluation of unvalidated expressions is a common
9
+ flaw in OGNL. This exposes the properties of Java objects to modification by an attacker and
10
+ may allow them to execute arbitrary code.</p >
10
11
</overview >
11
12
12
13
<recommendation >
13
- <p >The general recommendation is to not evaluate untrusted ONGL expressions. If user provided OGNL
14
- expressions must be evaluated, do this in sandbox (add <code >-Dognl.security.manager</code > to JVM arguments)
15
- and validate the expressions before evaluation.</p >
14
+ <p >The general recommendation is to avoid evaluating untrusted ONGL expressions. If user-provided OGNL
15
+ expressions must be evaluated, do this in a sandbox and validate the expressions before evaluation.</p >
16
16
</recommendation >
17
17
18
18
<example >
19
19
<p >In the following examples, the code accepts an OGNL expression from the user and evaluates it.
20
20
</p >
21
21
22
- <p >In the first example, the user provided OGNL expression is parsed and evaluated.</p >
22
+ <p >In the first example, the user- provided OGNL expression is parsed and evaluated.</p >
23
23
24
- <p >The second example validates the expression and evaluates it inside the sandbox.</p >
24
+ <p >The second example validates the expression and evaluates it inside a sandbox.
25
+ You can add a sandbox by setting a system property, as shown in the example, or by adding
26
+ <code >-Dognl.security.manager</code > to JVM arguments.</p >
25
27
26
28
<sample src =" OgnlInjection.java" />
27
29
</example >
28
30
29
31
<references >
30
- <li ><a href =" https://github.com/jkuhnert/ ognl/" >OGNL library </a >.</li >
32
+ <li >Apache Commons: <a href =" https://commons.apache.org/proper/commons- ognl/" >Apache Commons OGNL </a >.</li >
31
33
<li >Struts security: <a href =" https://struts.apache.org/security/#proactively-protect-from-ognl-expression-injections-attacks-if-easily-applicable" >Proactively protect from OGNL Expression Injections attacks</a >.</li >
32
34
</references >
33
- </qhelp >
35
+ </qhelp >
0 commit comments