-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring Security 6.1.2 String requestMatchers error UnsupportedOperationException #13609
Comments
I've run into the same issue and I've reverted to Spring Security 6.0.4 as per the recommendation here. This works for me. I wasn't willing to go down the path of using
|
I ran into an similar issue, so i reverted back to spring-security 6.1.1 which ist not ideal, because of CVE-2023-34034. Here my code, that causes the error mesage: @configuration
} |
Okay, I traced the problem a little. The Issue is that i use a WebApplicationInitializer adding a ContextLoaderListener. If I remove the ContextLoaderListener from the equation, it works (but I am not sure, if every part of the application is loaded). However I thought I followed the example from javadoc of org.springframework.web.WebApplicationInitializer. So how can I do this compatible with Spring-Security 6.1.2+: public class MyWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer { public class MyContextLoaderListener extends ContextLoaderListener {
} |
any updates on this? I'm seeing similar issues on 5.8.9 |
Upgrading our application to Spring 6 with Spring Security 6.1.2 and Tomcat 10.1 resulted in the following UnsupportedOperationException:
The code that caused this is:
Our current workaround is to not use
requestMatchers
with String arguments but to pass aAntPathRequestMatcher
.This ensures our application works again.
Working code:
The implementation of the
requestMatchers
method was altered in response to CVE https://spring.io/security/cve-2023-34035PR and commit can be found in this issue: #13551
The
requestMatchers
method has been changed to callservletContext.getServletRegistrations();
in commitTomcat does not seem to allow this and throws the UnsupportedOperationException.
This also matches the javadoc of the getServletRegistrations method
While searching for a solution I found this old issue #4027 that had the same exception after a code change that also used
servletContext.getServletRegistrations();
.This was reverted by this PR: #4031
It seems that the mitigation for cve-2023-34035 might need a different solution to ensure it works on tomcat 10.1?
The text was updated successfully, but these errors were encountered: