Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreApplications that evaluate Spring Expression Language (SpEL) expressions using
SimpleEvaluationContext may be vulnerable to a safety guard bypass when the SpEL
expression compiler is active.
Specifically, an application is vulnerable when all of the following conditions are met:
SimpleEvaluationContext.spring.expression.compiler.mode system property or Spring property has been set to
IMMEDIATE or MIXED, or because a SpelParserConfiguration with SpelCompilerMode
set to IMMEDIATE or MIXED was used to create the SpelExpressionParser.When all conditions are met, the SpEL compiler can silently compile expressions evaluated
within a SimpleEvaluationContext, causing subsequent evaluations to bypass all safety
guards that are enforced during interpreted evaluation. The compiler may also cause
unbounded class-loading growth, as each distinct compilable expression results in a new
class being generated and loaded into a child ClassLoader.
Spring Framework:
| Fix version | Availability |
|---|---|
| 7.0.9 | OSS |
| 7.0.8.1 | Enterprise Support Only |
| 6.2.20 | Enterprise Support Only |
| 6.1.29 | Enterprise Support Only |
| 6.0.31 | Enterprise Support Only |
| 5.3.50 | Enterprise Support Only |
| 5.2.26 | Enterprise Support Only |
Fixed versions of Spring Framework ensure that SimpleEvaluationContext does not support
expression compilation by default, regardless of the compiler mode configured via
SpelParserConfiguration or the spring.expression.compiler.mode system property or
Spring property. Applications that intentionally use SimpleEvaluationContext with
trusted expressions and require compilation for performance reasons can opt in by calling
withCompilationSupported() on the SimpleEvaluationContext builder. Care should be
taken when opting in to compilation, as doing so removes the safety guards applied during
interpreted evaluation.
This issue was discovered internally by the Spring Framework team.
To report a security vulnerability for a project within the Spring portfolio, see the Security Policy