-
Notifications
You must be signed in to change notification settings - Fork 602
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
ServletRequest.getContextPath() might return wrong value when OIDC app is in used. #6659
Comments
Summary: This problem only happens when security OIDC_client is used to authenticate the user. After the OIDC authentication, user's application landing page /SystemTest/ is served. It dispatches forward to a welcome file index.jsp. With some debug traces showing the WebAppDispatcherContext and WebApp objects inside the index.jsp service() //beginning of service() [APP/PROC/WEB/0] OUT [2/15/19 17:04:26:761 UTC] 00000032 servlet > com.ibm.ws.webcontainer.servlet.ServletWrapper service ServletWrapper[/index.jsp:[]] ,req-->com.ibm.ws.webcontainer31.srt.SRTServletRequest31@59ecbc76 ,res-->com.ibm.ws.web //The WebAppDispatcherContext is used to retrieve the associated WebApp. In the middle of service, the same .WebAppDispatcherContext@e9461705 is used but the associated WebApp has changed [APP/PROC/WEB/0] OUT [2/15/19 17:04:26:771 UTC] 00000032 SystemOut O DEBUG, TS001811684, getContextPath, this -> com.ibm.ws.webcontainer31.srt.SRTServletRequest31@59ecbc76 There are only 3 ways to change the associated protected WebApp _webapp inside the WebAppDispatcherContext: 1) during the contruction of the new WebAppDispatcherContext()2) setter setWebApp(WebApp)3) any subClass of WebAppDispatcherContext can change this protected _webapp.Even with the debug module, there is no log showing the setWebApp() was used to change the _webapp. Since the WebAppDispatcherContext is the same, there is no new constructor was called (i.e not via path #1) One last possible path is #3 that someone has changed this protected _webapp directly from a subclass of WebAppDispatcherContext. However, we can find any other subClass of WebAppDispatcherContext from the security oidc code (Chunglong confirmed). Security team can also not be able to find any reflection from their code to change this _webapp. So we still do NOT know the root cause of this. Solution: After I changed from protected _webapp to private _webApp and force everything through the setWebApp(WebApp), it resolved the problem in the customer's env. They can not reproduce the problem in many other clients sides. |
No description provided.
The text was updated successfully, but these errors were encountered: