spring-projects / spring-projects/spring-security
Remember-me token is not invalidated on logout with expired or invalid session
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
Describe the bug
The remember-me token is not invalidated when navigating to the logout URL using a request which includes both of:
- a missing, invalid, or expired session cookie
- a valid remember-me token cookie
This occurs because the spring-security logout filter is applied before session-management, remember-me authentication, and any other authentication filters.
To Reproduce
- Login to a spring-security application, with session management, remember-me authentication, and logout configured.
- Remove the session cookie, or replace with an invalid cookie.
- Navigate to the logout URL.
- Attempt to auto-login using the remember-me token, login succeeds.
Step 2 is not likely to occur in practice. However, the following is possible in a real-world-scenario, but is difficult to reproduce. During the login request (step 2), the following occurs:
- The session cookie in the browser is included in the logout request, and the request sent.
- The session expires.
- The server subsequently receives the request.
In this scenario, the remember-me token should definitely be invalidated. However, I expect that it would not be as the LogoutFilter is applied before the session-management and remember-me authentication filters.
Expected behavior
In the above scenarios, we expect the remember-me token to have been invalidated. Thus subsequent auto-login attempts using that token should fail.
Sample
Not provided.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the logout URL through the LogoutFilter, session-management, and remember-me authentication filters described in the issue. Reproduce the request with an invalid or expired session cookie and a valid remember-me token. Done means logout invalidates the remember-me token and a subsequent auto-login attempt fails.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- authentication, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100