CVE-2026-59273
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Spring Security is a framework that provides authentication, authorization, and protection against common attacks for Java applications built on the Spring Framework.
A remote code execution vulnerability (CVE-2026-59273) has been identified in the ELRequestMatcher class of Spring Security, which allows attackers who control input bound to a RequestMatcher property to run arbitrary code in the application's process.
Per OWASP: Code Injection is the general term for attack types which consist of injecting code that is then interpreted/executed by the application.
This issue affects multiple versions of Spring Security.
Details
Module Info
- Product: Spring Security
- Affected packages:
org.springframework.security:spring-security-web - Affected versions: <=5.7.26, >=5.8.0 <=5.8.28, >=6.4.0 <=6.4.19, >=6.5.0 <=6.5.12, >=7.0.0 <=7.0.8, >=7.1.0 <=7.1.2
- GitHub repository: https://github.com/spring-projects/spring-security
- Published packages: https://central.sonatype.com/artifact/org.springframework.security/spring-security-web
- Package manager: Maven
- Fixed in:
- OSS Spring Security 7.0.9, 7.1.3
- NES for Spring Security
Vulnerability Info
This Critical-severity vulnerability is found in the org.springframework.security:spring-security-web package in multiple versions of Spring Security.
ELRequestMatcher parses a String as a Spring Expression Language (SpEL) expression and evaluates it against each incoming request. Its documented purpose is to call the request-matching helpers hasIpAddress() and hasHeader() on its ELRequestMatcherContext root object. The evaluation context it builds, however, is a StandardEvaluationContext:
public ELRequestMatcher(String el) {
SpelExpressionParser parser = new SpelExpressionParser();
this.expression = parser.parseExpression(el);
}
@Override
public boolean matches(HttpServletRequest request) {
EvaluationContext context = createELContext(request);
return this.expression.getValue(context, Boolean.class);
}
public EvaluationContext createELContext(HttpServletRequest request) {
return new StandardEvaluationContext(new ELRequestMatcherContext(request));
}A StandardEvaluationContext places no limits on the expression. It resolves type references such as T(java.lang.Runtime), invokes arbitrary methods on any object the expression reaches, and allows full reflection, so an expression such as T(java.lang.Runtime).getRuntime().exec('...') runs as soon as matches() is called.
Spring Security also ships RequestMatcherEditor, a JavaBeans property editor that turns any String into an ELRequestMatcher:
public class RequestMatcherEditor extends PropertyEditorSupport {
@Override
public void setAsText(String text) throws IllegalArgumentException {
setValue(new ELRequestMatcher(text));
}
}Because the editor sits beside the RequestMatcher interface and follows the <Type>Editor naming convention, Spring Framework's data binding discovers it automatically for any property of type RequestMatcher. An application that binds external input, such as request parameters or externally supplied configuration, to such a property therefore turns that input into a SpEL expression, which is then evaluated with unrestricted access the next time the matcher is applied to a request. An attacker who controls that input can execute arbitrary code with the privileges of the application.
Mitigation
Only recent versions of Spring Security receive community support. Older lines are End-of-Life and will not receive public updates to address this issue.
Users of the affected components should apply one of the following mitigations:
- Upgrade to a currently supported version of Spring Security.
- Leverage a commercial support partner like HeroDevs for post-EOL security support.