From 7a4858d65f2431396c2f4dadbc3d654712bc02a8 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Thu, 3 May 2012 17:47:58 -0700 Subject: [PATCH] [FIXED JENKINS-12585] restrict where sessions are created. If a resource with 'Set-Cookie' header is cached (either by intermediary like HTTP proxy and reverse proxy, or by the browser), it'll cause identity swap / session mix-up as discussed in this ticket. I suspect this was caused by HttpSessionContextIntegrationFilter2, which is the only code path that attempts to create a session when a request to a static resource is made. So I'm disabling the creation of session in HttpSessionContextIntegrationFilter2. This in turn requires that we have sessions already created when the authentication was successful and people need to login (or else the login will have no effect.) We already do so in layout.jelly, so any request that renders a Jenkins page would have a session, but I've also added it in AuthenticationProcessingFilter2, which ensures that a successful login does have a session. --- changelog.html | 3 +++ .../security/AuthenticationProcessingFilter2.java | 12 ++++++++++++ core/src/main/resources/lib/layout/layout.jelly | 8 +++++++- .../webapp/WEB-INF/security/SecurityFilters.groovy | 6 ++++++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 027282dea2..67efbdc753 100644 --- a/changelog.html +++ b/changelog.html @@ -55,6 +55,9 @@ Upcoming changes