Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreSpring Security, versions 5.7 prior to 5.7.5 and 5.6 prior to 5.6.9 could be susceptible to authorization rules bypass via forward or include dispatcher types.
Specifically, an application is vulnerable when all of the following are true:
AuthorizationFilter
either manually or via the authorizeHttpRequests()
method.FilterChainProxy
to apply to forward and/or include requests (e.g. spring.security.filter.dispatcher-types = request, error, async, forward, include
).authorizeHttpRequests().shouldFilterAllDispatcherTypes(true)
An application is not vulnerable if any of the following is true:
authorizeHttpRequests()
or the AuthorizationFilter
.Users of affected versions should apply the following mitigations:
authorizeRequests().filterSecurityInterceptorOncePerRequest(false)
instead of authorizeHttpRequests().shouldFilterAllDispatcherTypes(true)
shouldFilterAllDispatcherTypes
available, should add an ObjectPostProcessor
:authorizeHttpRequests().withObjectPostProcessor(new
ObjectPostProcessor() {
@Override
public O postProcess(O filter) {
filter.setObserveOncePerRequest(false);
filter.setFilterAsyncDispatch(true);
filter.setFilterErrorDispatch(true);
return filter;
}});
Note that in Spring Security 5, the default behavior is to not apply the filters more than once to a request, therefore you have to explicitly configure Spring Security to do that. In addition, the FilterChainProxy is also not configured to be invoked on forward and include dispatcher types, depending on you to do it yourself.
Releases that have fixed this issue include:
This issue was identified and responsibly reported by Osword from SGLAB of Legendsec at Qi'anxin Group.
To report a security vulnerability for a project within the Spring portfolio, see the Security Policy