CVE-2026-59430
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Spring Framework is an open-source application framework for building enterprise Java applications. It provides dependency injection, data binding, type conversion and the Spring Expression Language (SpEL), which applications use to evaluate expressions against their objects at runtime.
An authorization bypass vulnerability (CVE-2026-59430) has been identified in the SimpleEvaluationContext of Spring Framework's SpEL module, which allows attackers who can supply SpEL expressions to invoke constructors and methods through implicit type conversion. This gets around the restrictions SimpleEvaluationContext places on constructor and method invocation.
Per OWASP: Access control enforces policy such that users cannot act outside of their intended permissions. Failures typically lead to unauthorized information disclosure, modification, or destruction of all data or performing a business function outside the user's limits.
This issue affects multiple versions of Spring Framework.
Details
Module Info
- Product: Spring Framework
- Affected packages:
org.springframework:spring-expression - Affected versions: >=7.0.0 <=7.0.10, >=6.2.0 <=6.2.20, >=6.1.0 <=6.1.29, >=6.0.0 <=6.0.32, >=5.3.0 <=5.3.50, <=5.2.26.RELEASE
- GitHub repository: https://github.com/spring-projects/spring-framework
- Published packages: https://central.sonatype.com/artifact/org.springframework/spring-expression
- Package manager: Maven
- Fixed in:
- OSS Spring Framework 7.0.11
- NES for Spring Framework
Vulnerability Info
This Medium-severity vulnerability is found in the org.springframework:spring-expression package in multiple versions of Spring Framework. SimpleEvaluationContext is the evaluation context intended for evaluating less trusted SpEL expressions: it supports only a subset of the language and blocks type references, constructor calls and bean references, and method invocation unless explicitly enabled. Applications are exposed when they evaluate untrusted or user-controlled SpEL expressions with a SimpleEvaluationContext that uses its default type converter, or one configured with a TypeConverter or ConversionService that includes the default converters of DefaultConversionService.
When no type converter is registered through the builder, SimpleEvaluationContext creates a StandardTypeConverter with no arguments:
this.typeConverter = (converter != null ? converter : new StandardTypeConverter());That converter delegates to the shared DefaultConversionService instance:
public StandardTypeConverter() {
this.conversionService = DefaultConversionService::getSharedInstance;
}DefaultConversionService.addDefaultConverters() registers two generic Object-to-Object converters that work by reflection:
converterRegistry.addConverter(new ObjectToObjectConverter());
converterRegistry.addConverter(new IdToEntityConverter((ConversionService) converterRegistry));ObjectToObjectConverter converts a value to a target type by calling a to<TargetType>() method on the source object, a static valueOf, of or from method on the target type, or a constructor of the target type that takes the source value. IdToEntityConverter calls a static find<EntityName> method on the target type. SpEL performs implicit type conversion whenever a value has to match a declared type: when a property is assigned (sku = 'ABC-123'), when a map is indexed with a key of a different type (skus['ABC-123']), and when an argument is passed to a method enabled with withInstanceMethods(). In each case an attacker-controlled string reaches one of these converters, which reflectively invokes a constructor or a static factory or finder method on any type reachable from the evaluation root, or a conversion method on the source object. The expression cannot call these members directly under SimpleEvaluationContext, but the conversion step calls them on its behalf.
Steps to Reproduce
- Add
org.springframework:spring-expression6.2.19 (or any affected version) to a Java project. - Run the following class. It evaluates a property assignment in a read-write
SimpleEvaluationContextagainst a bean whoseskuproperty has a type with aStringconstructor.
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.SimpleEvaluationContext;
public class Repro {
public static class Sku {
public Sku(String value) {
System.out.println("Sku constructor invoked with: " + value);
}
}
public static class Catalog {
private Sku sku;
public Sku getSku() { return sku; }
public void setSku(Sku sku) { this.sku = sku; }
}
public static void main(String[] args) {
SimpleEvaluationContext context = SimpleEvaluationContext.forReadWriteDataBinding().build();
new SpelExpressionParser().parseExpression("sku = 'ABC-123'").getValue(context, new Catalog());
}
}- On an affected version the program prints
Sku constructor invoked with: ABC-123, showing that the expression ran a constructor even thoughSimpleEvaluationContextdoes not support constructor calls. On Spring Framework 7.0.11 the same evaluation fails with aSpelEvaluationExceptionreporting a type conversion failure.
Mitigation
Only recent versions of Spring Framework receive community support. Older lines are End-of-Life and will not receive public updates to address this issue.
Applications that cannot upgrade right away can configure each SimpleEvaluationContext with a custom ConversionService that supports only the conversions the application needs, for example a GenericConversionService with explicitly registered converters:
GenericConversionService conversionService = new GenericConversionService();
conversionService.addConverter(String.class, Integer.class, Integer::valueOf);
SimpleEvaluationContext context = SimpleEvaluationContext.forReadOnlyDataBinding()
.withConversionService(conversionService)
.build();Users of the affected components should apply one of the following mitigations:
- Upgrade to a currently supported version of Spring Framework.
- Leverage a commercial support partner like HeroDevs for post-EOL security support.
Credits
WangYuhui (finder)