The protection against session fixation is switched off

tx0/java:session-fixation-offdefaulterrorsecurity, cwe-384

What it finds

By default Spring Security gives a user a new session when they log in, so that a session id planted before the login does not become authenticated. sessionFixation() .none() keeps the old session, and with it any id an attacker made the victim use (CWE-384).

Reported is none() called on the result of sessionFixation().

From the rule's source, session_fixation_off.rs.

Example from the rule's tests
class Security {  void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception {    http.sessionManagement().sessionFixation().none();tx0 reports: stays valid after it    http.sessionManagement().sessionFixation().migrateSession();  }}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:

tx0.toml
[rules]
"tx0/java:session-fixation-off" = "off"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/java:session-fixation-off] reason="..."

tx0 explain tx0/java:session-fixation-off shows the same in the terminal. Found a false positive? Report it.