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

Jetty 12.0.0 return wrong value for HttpServletRequest.isRequestedSessionIdValid #10323

Closed
ghost opened this issue Aug 16, 2023 · 1 comment
Closed
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@ghost
Copy link

ghost commented Aug 16, 2023

Jetty version(s)
12.0.0

Jetty Environment
ee10 (embedded Jetty)

Java version/vendor (use: java -version)
OpenJDK 20

OS type/version
Fedora 38, Ubuntu 23.04

Description
When a request with a session ID in a URL parameter that refers to a session that is does not exist

request.isRequestedSessionIdFromURL()

returns true (correct), but

request.isRequestedSessionIdValid()

also returns true (incorrect).

How to reproduce?

I reproduce this by

1 - start my Jetty embedding application
2 - enter the URL into the browser
3 - login creating a user session and being redirected to a URL with a session ID parameter
4 - stop/start the application after which the session no longer exists
5 - refresh the page with the URL holding the ID of the no longer existing session
6 - expect the page to redirect to a URL without a session ID parameter
7 - see that this does not happen

The application checks both methods and in case of

request.isRequestedSessionIdFromURL() && !request.isRequestedSessionIdValid()

a redirect response is generated to the same URL without the session ID parameter. This does not work in Jetty 12.

@ghost ghost added the Bug For general bugs on Jetty side label Aug 16, 2023
@janbartel janbartel self-assigned this Aug 16, 2023
@joakime joakime moved this to 🏗 In progress in Jetty 12.0.1 - FROZEN Aug 16, 2023
janbartel added a commit that referenced this issue Aug 17, 2023
janbartel added a commit that referenced this issue Aug 18, 2023
* Issue #10323 Fix ee10 Request.isRequestedSessionIdValid
@janbartel
Copy link
Contributor

Thanks for the report. Fixed via #10331

@joakime joakime moved this from 🏗 In progress to ✅ Done in Jetty 12.0.1 - FROZEN Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
Development

No branches or pull requests

1 participant