Skip to content

Commit 80ac2af

Browse files
Fixed typos
Co-authored-by: Marcono1234 <[email protected]>
1 parent 6c24699 commit 80ac2af

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

java/ql/src/experimental/Security/CWE/CWE-094/JakartaExpressionInjection.qhelp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
<overview>
55
<p>
66
Jakarta Expression Language (EL) is an expression language for Java applications.
7-
There are a single language specification and multiple implementations
7+
There is a single language specification and multiple implementations
88
such as Glassfish, Juel, Apache Commons EL, etc.
99
The language allows invocation of methods available in the JVM.
1010
If an expression is built using attacker-controlled data,
11-
and then evaluated, then it may allow the attacker to run arbitrary code.
11+
and then evaluated, it may allow the attacker to run arbitrary code.
1212
</p>
1313
</overview>
1414

1515
<recommendation>
1616
<p>
1717
It is generally recommended to avoid using untrusted data in an EL expression.
18-
Before using untrusted data to build an EL expressoin, the data should be validated
19-
to ensure it is not evaluated as expression language. If the EL implementaion offers
20-
configuring a sandbox for EL expression, they should be run in a restircitive sandbox
18+
Before using untrusted data to build an EL expression, the data should be validated
19+
to ensure it is not evaluated as expression language. If the EL implementation offers
20+
configuring a sandbox for EL expressions, they should be run in a restrictive sandbox
2121
that allows accessing only explicitly allowed classes. If the EL implementation
22-
does not allow sandboxing, consider using other expressiong language implementations
22+
does not support sandboxing, consider using other expression language implementations
2323
with sandboxing capabilities such as Apache Commons JEXL or the Spring Expression Language.
2424
</p>
2525
</recommendation>
@@ -32,9 +32,9 @@ using the JUEL interpreter:
3232
<sample src="UnsafeExpressionEvaluationWithJUEL.java" />
3333

3434
<p>
35-
JUEL does not allow to run expression in a sandbox. To prevent running arbitrary code,
36-
incoming data has to be checked before including to an expression. The next example
37-
uses a Regex pattern to check whether a user tries to run an allowed exression or not:
35+
JUEL does not support to run expressions in a sandbox. To prevent running arbitrary code,
36+
incoming data has to be checked before including it in an expression. The next example
37+
uses a Regex pattern to check whether a user tries to run an allowed expression or not:
3838
</p>
3939
<sample src="SaferExpressionEvaluationWithJUEL.java" />
4040

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
String input = getRemoteUserInput();
22
String pattern = "(inside|outside)\\.(temperature|humidity)";
33
if (!input.matches(pattern)) {
4-
throw new IllegalArgumentException("Unexpected exression");
4+
throw new IllegalArgumentException("Unexpected expression");
55
}
66
String expression = "${" + input + "}";
77
ExpressionFactory factory = new de.odysseus.el.ExpressionFactoryImpl();
88
ValueExpression e = factory.createValueExpression(context, expression, Object.class);
99
SimpleContext context = getContext();
10-
Object result = e.getValue(context);
10+
Object result = e.getValue(context);

0 commit comments

Comments
 (0)