Latest in branch 6.1
6.1.9
Released 15 Apr 2024
(2 years ago)
SoftwareSpring Security
Branch6.1
Supported
Java/Jakarta EE
Java 17+
Jakarta EE 9+ (Servlet 5.0+)
Initial release6.1.0
15 May 2023
(3 years ago)
Latest release6.1.9
15 Apr 2024
(2 years ago)
End of
OSS support
30 Jun 2024
(Ended 1 year, 10 months ago)
End of
enterprise support
30 Jun 2025
(Ended 10 months ago)
Release noteshttps://github.com/spring-projects/spring-security/releases/tag/6.1.9
Source codehttps://github.com/spring-projects/spring-security/tree/6.1.9
Downloadhttps://github.com/spring-projects/spring-security/releases/tag/6.1.9
Spring Security 6.1 ReleasesView full list

What Is New in Spring Security 6.1

CategoryHighlights
New FeaturesRationale for deprecating .and() and non-lambda DSL methods; refreshed CSRF documentation.
Bug FixesCookieCsrfTokenRepository header handling; RememberMeAuthenticationFilter respects SecurityContextRepository; rolePrefix empty string 400 bug; SAML IE11 login; OAuth2 resource server start-up with Actuator; duplicate scope close in SimpleAroundFilterObservation; several documentation fixes.
Deprecations.and() and other non-lambda DSL methods are now deprecated in favor of the lambda-style configuration.

Why is the .and() method being deprecated and what should I use instead?

The .and() method is deprecated to push developers toward the more expressive lambda DSL that aligns with Spring Boot's functional style.

  • All configuration now prefers the http.authorizeHttpRequests(authz -> ...) pattern.
  • Kotlin users must import org.springframework.security.config.annotation.web.builders.httpSecurity to access the DSL.
  • Legacy .and() chains still compile but emit deprecation warnings.
http
    .authorizeHttpRequests(authz -> authz
        .requestMatchers("/admin/**").hasRole("ADMIN")
        .anyRequest().authenticated())
    .formLogin(withDefaults());

How has CSRF handling been improved in 6.1?

CSRF documentation has been revisited and the CookieCsrfTokenRepository now preserves existing Set-Cookie headers instead of overwriting them.

  • When multiple cookies are set (e.g., session and CSRF), the repository appends its cookie rather than replacing prior ones.
  • Developers should verify that custom response headers are not unintentionally lost after upgrading.
http.csrf(csrf -> csrf
    .csrfTokenRepository(new CookieCsrfTokenRepository()));

What authentication-related bugs were fixed and do they affect my production environment?

Several bugs that could break authentication flows have been resolved.

  • RememberMeAuthenticationFilter now correctly uses the configured SecurityContextRepository.
  • Setting rolePrefix("") no longer returns HTTP 400 (fixed in 6.0.3 onward).
  • SAML logins work in Internet Explorer 11 again.
  • OAuth2 resource server applications start cleanly with Spring Boot 3.0 and Actuator enabled.
  • SimpleAroundFilterObservation no longer calls scope.close() twice, preventing resource leaks.

Which third-party libraries were upgraded and should I take any action?

Spring Security 6.1 bundles newer versions of many dependencies to stay compatible with Spring Boot 3.0.6 and the latest ecosystem.

  • Jackson 2.14.3, JUnit 5.9.3, Logback 1.4.7, Micrometer 1.10.7, Reactor 2022.0.7, Reactor-Netty 1.1.7, Nimbus 9.43.2, Kotlin 1.8.21.
  • These upgrades are transitive; no code changes are required unless you have version-pinned overrides.
  • Review your dependencyManagement sections to avoid conflicts with older versions.

Frequently Asked Questions

Is the deprecation of .and() a breaking change for existing configurations?
It is not breaking; existing code continues to work but will emit deprecation warnings and should be migrated to the lambda DSL.

Do I need to change my CSRF setup after upgrading to 6.1?
If you rely on CookieCsrfTokenRepository you may see additional Set-Cookie headers but no functional change is required.

Will rolePrefix("") still cause a 400 error after the upgrade?
No, the bug that returned HTTP 400 for an empty role prefix has been fixed.

How do I configure the new lambda DSL for form login?
Use http.formLogin(form -> form.loginPage("/login").permitAll()) in your security filter chain.

Do the dependency upgrades affect my build time?
They may increase the size of the dependency graph slightly but should not noticeably affect build performance.

Is there any special migration step for OAuth2 resource server with Actuator?
Simply upgrade to Spring Boot 3.0.6 and the resource server will start without the previous startup failure.

Releases In Branch 6.1

VersionRelease date
6.1.915 Apr 2024
(2 years ago)
6.1.818 Mar 2024
(2 years ago)
6.1.716 Feb 2024
(2 years ago)
6.1.618 Dec 2023
(2 years ago)
6.1.516 Oct 2023
(2 years ago)
6.1.418 Sep 2023
(2 years ago)
6.1.321 Aug 2023
(2 years ago)
6.1.217 Jul 2023
(2 years ago)
6.1.119 Jun 2023
(2 years ago)
6.1.015 May 2023
(3 years ago)
6.1.0-RC117 Apr 2023
(3 years ago)
6.1.0-M220 Mar 2023
(3 years ago)
6.1.0-M116 Jan 2023
(3 years ago)