← Java / Spring · Contents

JAVA-049 / Intermediate

Disabling Spring Security session fixation protection

A07:2021 Identification and Authentication Failures · CWE-384 Session Fixation

Why is this a problem?

If the session ID remains unchanged before and after login, fixation attacks are possible.

How to fix it

java
http.sessionManagement(s -> s.sessionFixation().migrateSession());   // Default

Further reading