A way to avoid this is to never evaluate user input in an expression language.
You will almost never be able to list and, therefore, prevent the execution of all possible "bad" code.
Instead, you can use user input as environment variables (strings, numbers) with fixed EL expressions.
source share