Latest in branch 5.8
5.8.16
Released 18 Nov 2024
(1 year ago)
SoftwareSpring Security
Branch5.8
Supported
Java/Jakarta EE
Java 8+
Servlet 4.0+
Initial release5.8.0
21 Nov 2022
(3 years ago)
Latest release5.8.16
18 Nov 2024
(1 year ago)
End of
OSS support
31 Dec 2023
(Ended 2 years, 4 months ago)
End of
enterprise support
30 Jun 2029
(Ends in 3 years, 1 month)
Release noteshttps://github.com/spring-projects/spring-security/releases/tag/5.8.16
Source codehttps://github.com/spring-projects/spring-security/tree/5.8.16
Downloadhttps://github.com/spring-projects/spring-security/releases/tag/5.8.16
Spring Security 5.8 ReleasesView full list

What Is New in Spring Security 5.8

CategoryHighlights
New FeaturesMethodExpressionAuthorizationManager, full AuthorizationManager support, Kotlin WebTestClient example, Polish localization, requestMatchers & securityMatchers documentation, new AuthorizationFilter migration guide
Bug FixesCsrfAuthenticationStrategy token regeneration, IpAddressServerWebExchangeMatcher NPE fix, SecurityContextRepository caching, Bcrypt strength 31 handling, various SAML and OAuth2 fixes
DeprecationsResource Owner Password Credentials grant deprecated, improved deprecation notice for WebSecurityConfigurerAdapter

How does Spring Security 5.8 change the Authorization model?

The release introduces a full-blown AuthorizationManager API and an AuthorizationFilter that replaces the legacy FilterSecurityInterceptor.

  • MethodExpressionAuthorizationManager lets you use SpEL expressions directly on method security.
  • Support for AuthorizationManager is now wired into the DSL (authorizeHttpRequests), enabling fine-grained, composable rules.
  • The DefaultFilterChainValidator now checks that an AuthorizationFilter is present, helping you catch misconfigurations early.
  • Migration guide (Provide guide for migrating from FilterSecurityInterceptor to AuthorizationFilter) shows a drop-in replacement pattern.
http
    .authorizeHttpRequests((auth) -> auth
        .requestMatchers("/admin/**").hasRole("ADMIN")
        .anyRequest().authenticated())
    .authorizationManager(new MethodExpressionAuthorizationManager("hasAuthority('SCOPE_read')"));

In practice, teams can now express both URL-based and method-level policies with a single, testable manager.

What CSRF enhancements are included in Spring Security 5.8?

Spring Security 5.8 adds several CSRF hardening features and bug fixes.

  • Documentation for the default BREACH protection on CsrfToken is now explicit.
  • New "defer load" strategy lets you lazily obtain the token, reducing unnecessary cookie writes.
  • CsrfAuthenticationStrategy now correctly checks for an existing token and regenerates it when using CookieCsrfTokenRepository.
  • The CookieServerCsrfTokenRepository gained support for setting Max-Age on the cookie.
  • Bug fix: CsrfAuthenticationStrategy does not regenerate CsrfToken with CookieCsrfTokenRepository resolved.
http
    .csrf(csrf -> csrf
        .csrfTokenRepository(CookieServerCsrfTokenRepository.withHttpOnlyFalse())
        .requireCsrfProtectionMatcher(new AntPathRequestMatcher("/**"))
        .csrfTokenRequestHandler(new DeferredCsrfTokenRequestHandler()));

This matters if you rely on stateless APIs or need tighter BREACH mitigation.

Which deprecations and documentation updates should I review before upgrading?

Spring Security 5.8 marks the Resource Owner Password Credentials grant as deprecated and clarifies several migration paths.

  • OAuth2 client documentation now lists all deprecations, including the password grant.
  • Improved deprecation notice for WebSecurityConfigurerAdapter helps you spot legacy configurations.
  • New guides cover:
    • Opt-in for SHA-256 in Remember-Me services.
    • Using the new requestMatchers and securityMatchers DSL.
    • Migration to SecurityContextHolderFilter.
    • Reactive CSRF migration steps.
  • Polish localization added to exception messages, expanding i18n support.

Most teams will need to replace the password grant with Authorization Code or Client Credentials flows.

What new testing and language support does Spring Security 5.8 provide?

The release adds a Kotlin example that demonstrates integration with WebTestClient, making reactive security testing easier for Kotlin developers.

  • Example located under samples/kotlin/webtestclient shows how to configure SecurityWebFilterChain in a Kotlin DSL.
  • All Kotlin samples compile against Kotlin 1.7.21, matching the upgraded Kotlin runtime.
  • Dependency upgrades (e.g., Reactor 2020.0.25, Spring Framework 5.3.24) ensure compatibility with the latest Spring Boot releases.
@SpringBootTest
class SecurityWebTest {
    @Autowired lateinit var client: WebTestClient

    @Test
    fun `access protected endpoint`() {
        client.get().uri("/admin")
            .exchange()
            .expectStatus().isUnauthorized
    }
}

This matters if your codebase is Kotlin-first or you rely heavily on WebFlux testing.

Frequently Asked Questions

Do I need to change my existing URL security configuration when moving to AuthorizationFilter?
You can keep the same matchers; just replace FilterSecurityInterceptor with the new DSL and the filter will be auto-registered.

Is the Resource Owner Password Credentials grant removed in 5.8?
It is deprecated but still functional; you should migrate to a supported grant type.

Can I still use WebSecurityConfigurerAdapter in 5.8?
Yes, but a deprecation warning is shown and future releases will remove it.

How do I enable the new BREACH protection for CSRF tokens?
Set csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) and the default BREACH mitigation is applied.

What is the simplest way to test Spring Security with Kotlin?
Use the provided Kotlin WebTestClient example and configure the security filter chain with the Kotlin DSL.

Do the dependency upgrades in 5.8 require any code changes?
Most upgrades are binary compatible, but you may need to align your build plugins to the new Gradle 7.5.1 version.

Releases In Branch 5.8

VersionRelease date
5.8.1618 Nov 2024
(1 year ago)
5.8.1521 Oct 2024
(1 year ago)
5.8.1419 Aug 2024
(1 year ago)
5.8.1317 Jun 2024
(1 year ago)
5.8.1215 Apr 2024
(2 years ago)
5.8.1118 Mar 2024
(2 years ago)
5.8.1016 Feb 2024
(2 years ago)
5.8.918 Dec 2023
(2 years ago)
5.8.816 Oct 2023
(2 years ago)
5.8.718 Sep 2023
(2 years ago)
5.8.621 Aug 2023
(2 years ago)
5.8.517 Jul 2023
(2 years ago)
5.8.419 Jun 2023
(2 years ago)
5.8.317 Apr 2023
(3 years ago)
5.8.220 Feb 2023
(3 years ago)
5.8.119 Dec 2022
(3 years ago)
5.8.021 Nov 2022
(3 years ago)
5.8.0-RC118 Oct 2022
(3 years ago)
5.8.0-M319 Sep 2022
(3 years ago)
5.8.0-M215 Aug 2022
(3 years ago)
5.8.0-M118 Jul 2022
(3 years ago)