Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SessionFixationProtectionEvent is not published in Spring WebFlux #9189

Closed
dgempiuc opened this issue Nov 4, 2020 · 2 comments
Closed

SessionFixationProtectionEvent is not published in Spring WebFlux #9189

dgempiuc opened this issue Nov 4, 2020 · 2 comments
Assignees
Labels
in: web An issue in web modules (web, webmvc) status: invalid An issue that we don't feel is valid type: bug A general bug

Comments

@dgempiuc
Copy link

dgempiuc commented Nov 4, 2020

Describe the bug
with the default configuration, spring security invalidates the existing session when the user authenticates and creates a new one. it is sensible to prevent session fixation attack.

SessionFixationProtectionEvent is not working when I use it in ApplicationListener implementation.

To Reproduce

@Component
public class TestListener implements ApplicationListener<SessionFixationProtectionEvent> {
    @Override
    public void onApplicationEvent(SessionFixationProtectionEvent sessionFixationProtectionEvent) {
        System.out.println("session fixation event");
        System.out.println(sessionFixationProtectionEvent.getOldSessionId());
        System.out.println(sessionFixationProtectionEvent.getNewSessionId());
    }
}

Expected behavior
there is no stdout logs in console.

Sample
just create secure webflux project. for example, /hello api.

/hello (session-id=x)
/login (redirected to login,session-id=x)

after successfull authentication, session-id is set to y.

/hello (session-id=y)

@dgempiuc dgempiuc added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Nov 4, 2020
@dgempiuc dgempiuc closed this as completed Nov 6, 2020
@dgempiuc dgempiuc reopened this Nov 16, 2020
@jzheaux
Copy link
Contributor

jzheaux commented Nov 24, 2020

This appears related to #4961

@jzheaux jzheaux added in: web An issue in web modules (web, webmvc) and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 24, 2020
@rwinch
Copy link
Member

rwinch commented Dec 3, 2020

This does appear to be a duplicate. I'm closing in favor of gh-4961. @dgempiuc please reopen if you disagree

@rwinch rwinch closed this as completed Dec 3, 2020
@rwinch rwinch added the status: invalid An issue that we don't feel is valid label Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) status: invalid An issue that we don't feel is valid type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants