Latest in branch 6.0
6.0.8
Released 16 Oct 2023
(2 years ago)
SoftwareSpring Security
Branch6.0
Supported
Java/Jakarta EE
Java 17+
Jakarta EE 9+ (Servlet 5.0+)
Initial release6.0.0
21 Nov 2022
(3 years ago)
Latest release6.0.8
16 Oct 2023
(2 years ago)
End of
OSS support
31 Dec 2023
(Ended 2 years, 4 months ago)
End of
enterprise support
31 Dec 2024
(Ended 1 year, 4 months ago)
Release noteshttps://github.com/spring-projects/spring-security/releases/tag/6.0.8
Source codehttps://github.com/spring-projects/spring-security/tree/6.0.8
Downloadhttps://github.com/spring-projects/spring-security/releases/tag/6.0.8
Spring Security 6.0 ReleasesView full list

What Is New in Spring Security 6.0

CategoryHighlights
Breaking ChangesCsrfAuthenticationStrategy now aligns with CsrfFilter; FilterChainProxy registered for all dispatcher types.
New FeaturesTest runtime hints for @WithSecurityContext and WebTestUtils; Support for Jakarta WebSocket 2.1; Migration guide for CAS removal.
ImprovementsDocumentation updates for default SessionAuthenticationStrategy and DelegatingSecurityContextRepository; Better deprecation notice in WebSecurityConfigurerAdapter; Polish span and meter names.
Bug FixesCsrfAuthenticationStrategy token check; Instrumentation naming conventions; SAML logout log messages; UTF-8 writer for Saml2MetadataFilter.
Dependency UpgradesSpring Framework 6.0.0; Micrometer Observation 1.10.1; SLF4J 2.0.4; Spring LDAP 3.0.0; R2DBC H2 1.0.0.RELEASE.

How does Spring Security 6.0 handle servlet and Jakarta namespace changes?

Spring Security 6.0 aligns itself with Servlet API 6 and the Jakarta EE 9+ namespace, which means every javax.* import must be migrated to jakarta.*.

  • All internal filters now implement jakarta.servlet.Filter instead of javax.servlet.Filter.
  • Support for Jakarta WebSocket 2.1 has been added, enabling secure WebSocket endpoints under the new namespace.
  • Configuration classes that extend WebSecurityConfigurerAdapter still compile, but the underlying servlet types have changed.

In practice you will need to update your imports and any custom servlet-based beans. For example:

import jakarta.servlet.Filter;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

Most IDEs can refactor the package change automatically, but verify that any third-party libraries you use have also migrated to Jakarta.

What are the breaking changes around FilterChainProxy registration?

FilterChainProxy is now registered for all dispatcher types (REQUEST, FORWARD, INCLUDE, ERROR, ASYNC) by default.

  • This eliminates the need for manual DispatcherType configuration in FilterRegistrationBean.
  • If you previously limited the proxy to DispatcherType.REQUEST, you must review any custom filters that rely on that restriction.
  • The change is documented in the migration steps "Register FilterChainProxy for All Dispatcher Types".

Typical migration code:

FilterRegistrationBean<FilterChainProxy> registration = new FilterRegistrationBean<>(filterChainProxy);
registration.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.INCLUDE, DispatcherType.ERROR, DispatcherType.ASYNC);

Most teams can simply remove the explicit setDispatcherTypes call and rely on the new default.

What improvements were made to CSRF handling in Spring Security 6.0?

CSRF handling has been tightened: CsrfAuthenticationStrategy now checks for an existing token and is fully consistent with CsrfFilter.

  • The strategy no longer creates a duplicate token when one is already present, preventing unnecessary session state.
  • Logging has been added to warn when the token is missing or mismatched, aiding debugging.
  • These changes fix issue #12241 and bring the CSRF flow in line with the Servlet 6 security contract.

In practice, if you custom-implemented CsrfAuthenticationStrategy, verify that you are not manually generating a token before the filter runs.

Which observability and metric naming updates are included in Spring Security 6.0?

Span and meter names have been polished to follow the OpenTelemetry semantic conventions.

  • Micrometer Observation has been upgraded to 1.10.1, providing richer context for security events.
  • Instrumentation names now use lower-case, dot-separated format (e.g., spring.security.authentication.success).
  • These changes improve correlation with other Spring observability components and simplify dashboard queries.

When configuring custom metrics, align your naming with the new conventions to avoid duplicate or confusing entries.

Frequently Asked Questions

Do I need to change my import statements after upgrading to Spring Security 6.0?
Yes, all javax.* imports must be replaced with jakarta.* equivalents because the project now targets Servlet API 6.

Will existing CSRF tokens be invalidated after the upgrade?
No, the token handling logic has been fixed to reuse existing tokens, so sessions remain valid.

How can I disable the new default dispatcher types for FilterChainProxy?
You can create a custom FilterRegistrationBean and explicitly set the desired DispatcherType values.

Is there a code example for updating a filter import?
Replace import jakarta.servlet.Filter; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; in your filter class.

What should I do if my application uses the deprecated CAS module?
Follow the migration guide provided in the release notes to remove CAS support and replace it with an OAuth2 or OpenID Connect configuration.

Releases In Branch 6.0

VersionRelease date
6.0.816 Oct 2023
(2 years ago)
6.0.718 Sep 2023
(2 years ago)
6.0.621 Aug 2023
(2 years ago)
6.0.517 Jul 2023
(2 years ago)
6.0.419 Jun 2023
(2 years ago)
6.0.317 Apr 2023
(3 years ago)
6.0.220 Feb 2023
(3 years ago)
6.0.119 Dec 2022
(3 years ago)
6.0.021 Nov 2022
(3 years ago)
6.0.0-RC209 Nov 2022
(3 years ago)
6.0.0-RC118 Oct 2022
(3 years ago)
6.0.0-M719 Sep 2022
(3 years ago)
6.0.0-M618 Jul 2022
(3 years ago)
6.0.0-M518 May 2022
(4 years ago)
6.0.0-M416 May 2022
(4 years ago)
6.0.0-M322 Mar 2022
(4 years ago)
6.0.0-M221 Mar 2022
(4 years ago)
6.0.0-M117 Jan 2022
(4 years ago)