Spring Framework Safety Guard Bypass via SpEL Expression Compilation

MEDIUM | AUGUST 20, 2026 | CVE-2026-59283

Description

Applications 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:

  • The application evaluates SpEL expressions using SimpleEvaluationContext.
  • The SpEL expression compiler is active, either because the 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.

Affected Spring Products and Versions

Spring Framework:

  • 7.0.0 - 7.0.8
  • 6.2.0 - 6.2.19
  • 6.1.0 - 6.1.28
  • 6.0.0 - 6.0.30
  • 5.3.0 - 5.3.49
  • 5.2.25 and earlier

Mitigation

Users of affected versions should upgrade to the corresponding fixed version.
Fix versionAvailability
7.0.9OSS
7.0.8.1Enterprise Support Only
6.2.20Enterprise Support Only
6.1.29Enterprise Support Only
6.0.31Enterprise Support Only
5.3.50Enterprise Support Only
5.2.26Enterprise 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.

Credit

This issue was discovered internally by the Spring Framework team.

History

  • 2026-08-20: Initial vulnerability report published.

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all