33 "qhelp.dtd">
44<qhelp >
55<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 >
1011</overview >
1112
1213<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 >
1616</recommendation >
1717
1818<example >
1919<p >In the following examples, the code accepts an OGNL expression from the user and evaluates it.
2020</p >
2121
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 >
2323
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 >
2527
2628<sample src =" OgnlInjection.java" />
2729</example >
2830
2931<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 >
3133<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 >
3234</references >
33- </qhelp >
35+ </qhelp >
0 commit comments