
CVE-2026-59273 - Spring Security - Critical 9.8 - Remote - SpEL injection. ELRequestMatcher bound from external input evaluates with type access on 7.1.2; the same expression is refused on 7.1.3. Differential harness, inert payloads, no execution chain.
Spring Security's ELRequestMatcher evaluates its expression in an unrestricted
StandardEvaluationContext, which allows type references and static method access.
Spring's data binding will turn a supplied string into one of these matchers, so an
application that binds outside input onto a RequestMatcher-typed property hands
the expression evaluator a string it did not write.
Class: Expression injection reachable through data binding
Reach: Remote, on applications that bind external input to a RequestMatcher
Spring Security 7.1.0 - 7.1.2, 7.0.0 - 7.0.8, 6.5.0 - 6.5.12, 6.4.0 - 6.4.19, 5.8.0 - 5.8.28, 5.7.26 and earlier
| ID | CVE-2026-59273 |
| Class | Expression injection (SpEL) |
| Reach | Remote, conditional on application binding |
| CWE | CWE-94 / CWE-95 / CWE-470 |
| CVSS | Critical: 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (vendor) |
| Product | Spring Security |
| Affected | 7.1.2 and the ranges above |
| Fixed | 7.1.3, 7.0.9 open source; commercial patches for 6.x and 5.x |
| License | GNU Affero GPL v3.0 |
| Lab | JDK 17+, Maven, no server and no Docker |
Spring's BeanWrapperImpl accepts a plain string for a RequestMatcher property and
produces an ELRequestMatcher. On the vulnerable line, that matcher evaluates the
string in a StandardEvaluationContext, which permits type references and static
access. On the patched line the same expression is refused, because the context
became SimpleEvaluationContext.forReadOnlyDataBinding().withInstanceMethods().
The differential is the finding. Three payloads separate what each context allows:
| Payload | 7.1.2 | 7.1.3 | Why |
|---|---|---|---|
1 + 1 == 2 | matches | matches | Arithmetic is allowed in both contexts |
'witness'.toUpperCase() == 'WITNESS' | matches | matches | withInstanceMethods() survives the patch |
T(java.lang.Math).abs(-1) == 1 | matches | SpelEvaluationException | Type references are refused by SimpleEvaluationContext |
The third row is the discriminator. The second row matters for testing: a regression test that only exercises an instance method will pass on both versions and prove nothing.
Every payload is inert. There is no T(...) on a process class, no Runtime, no
ProcessBuilder, and no class loader work. Math.abs is the deepest call in the
repository. This is a reachability test, not a weaponised chain: it demonstrates that
the evaluator runs with type access on the vulnerable line and without it on the
patched line. It does not carry that to command execution.
That distinction is the point of the artifact. It is the regression test the fix should ship with, and it is safe to run on a build machine.
| Position | Method / sink | Recon / integrity / availability | Proven or inferred |
|---|---|---|---|
Application binds outside input to a RequestMatcher property | BeanWrapperImpl#setPropertyValue -> ELRequestMatcher(String) | Integrity (control flow) | Lab-proven. The bound value becomes ELRequestMatcher |
| The bound expression runs on request matching | ELRequestMatcher#matches -> Expression#getValue | Integrity | Lab-proven. typeref.matched=true on 7.1.2 |
| The expression reaches types and static methods | StandardEvaluationContext | Integrity | Lab-proven. T(java.lang.Math) resolves |
| Same expression on the patched line | SimpleEvaluationContext | n/a | Lab-proven. SpelEvaluationException |
| Read application data through reflection | type access | Confidentiality | Inferred from type access. Not exercised here |
| Invoke a process | type access | Availability | Inferred from the advisory. Not exercised here |
| Reach an application that never binds input to a matcher | n/a | n/a | Closed. The jar alone is not reachable |
Stays closed
| Axis | Why it is closed |
|---|---|
| Unauthenticated reach without a binding site | The precondition is a property of the application, not the library |
| Command execution in this repository | No process payload exists here, by design |
| The patch allowing the same expression | 7.1.3 refuses the type reference outright |
The advisory attributes discovery to a property editor registered by naming convention. On both releases the JDK lookup returns nothing:
editor=none
The bind still succeeds, through the ELRequestMatcher(String) constructor that
Spring's type conversion finds. That is the narrower thing to audit: an application
is exposed when outside input can reach a RequestMatcher-typed property, not when a
PropertyEditor happens to be registered. Both halves point at the same sink, and the
constructor is the one that fires on a stock classpath.
The patch is visible in the bytecode rather than in behaviour alone:
$ javap -p -c -classpath spring-security-web-7.1.2.jar ...ELRequestMatcher
createELContext
0: new #50 // class org/springframework/expression/spel/support/StandardEvaluationContext
$ javap -p -c -classpath spring-security-web-7.1.3.jar ...ELRequestMatcher
createELContext
0: invokestatic #50 // SimpleEvaluationContext.forReadOnlyDataBinding
3: invokevirtual #56 // SimpleEvaluationContext$Builder.withInstanceMethods
withInstanceMethods() is still on the builder, which is why instance methods keep
working after the fix and why the type reference is the only reliable probe.
python3 cve-2026-59273-spring-security-elmatcher-Abraxas-Labs.py
or directly:
cd lab && ./run.sh
The runner resolves both pins from Maven Central, compiles once per version, and
prints one RESULT line each. It exports -Djava.net.preferIPv4Stack=true, because
some networks hand the JVM an AAAA record with no working IPv6 route and Maven then
reports No route to host.
# vulnerable 7.1.2
RESULT label=7.1.2 elMatcher=yes editor=none arith.matched=true instance.matched=true typeref.matched=true
# patched 7.1.3
RESULT label=7.1.3 elMatcher=yes editor=none arith.matched=true instance.matched=true typeref.matched=false typeref.error=SpelEvaluationException
Recorded on JDK 27.0.1 with Maven 3.10.0, macOS arm64.
Other affected lines:
VULN=7.0.8 FIXED=7.0.9 ./run.sh
Upgrade to 7.1.3 or 7.0.9. On Spring Boot 4.x, 4.1.3 or 4.0.10 pulls the corresponding Spring Security. Releases 6.5.13, 6.4.20, 5.8.29, and 5.7.27 are commercial support only, so installs on those lines stay exposed until they have a support agreement. There is no configuration workaround in the advisory.
If you cannot upgrade, do not bind external input onto a RequestMatcher-typed
property. That binding is the whole reachability condition.
Abraxas Labs - [email protected]