spring-projects / spring-projects/spring-security
Why old session ID value from the headers cookie in savedRequest is not replaced?
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
Summary
In RequestCacheAwareFilter, after a saved request is found, it replaced the request headers down the chain. As a result , the session id in the header will be set to the stale one from the old. I cannot think of any valid use case where a stale session id is useful. This is especially a problem when used together with Zuul because Zuul is then forwarding the request with a stale session ID and will fail authentication with no doubt.
I fixed the problem by writing override RibbonRoutingFIlter with my own implementation, where I manipulated the outgoing headers. But I don't see any reason why this cannot become the default behaviour in RequestCacheAwareFilter.
Version
spring-security-web-4.2.2.RELEASE
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 at RequestCacheAwareFilter and trace how a saved request's headers are restored; compare the behavior with the custom RibbonRoutingFilter described in the issue and the Zuul forwarding path. Done means stale session-ID headers from the saved request are not forwarded, while the resulting request still authenticates correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- authentication, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100