Skip to content

Commit 6e67b42

Browse files
committed
deprecate HttpSessionSecurityCookieFilter
This fixes ArcBees#484 HttpSessionSecurityCookieFilter duplicates the JSESSIONID in another cookie, one that can't be marked 'Htt pOnly'. That means in an XSS attack the attacker could read the JSESSIONID and hijack the session. Instead we should use RandomSecurityCookieFilter which doesn't have this issue (since it doesn't duplicate the JSESSIONID).
1 parent edc7b47 commit 6e67b42

File tree

7 files changed

+20
-6
lines changed

7 files changed

+20
-6
lines changed

gwtp-core/gwtp-dispatch-rpc-server-guice/src/main/java/com/gwtplatform/dispatch/rpc/server/guice/HttpSessionSecurityCookieFilter.java

+4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@
3535
* </pre>
3636
* <p/>
3737
* You also have to use a {@code .jsp} file instead of a {@code .html} as your main GWT file.
38+
*
39+
* @deprecated Please use {@link com.gwtplatform.dispatch.rpc.server.guice.RandomSecurityCookieFilter}.
40+
* Using the JSESSIONID like this might let an XSS attacker hijack a session. See GitHub issue #484
3841
*/
42+
@Deprecated
3943
@Singleton
4044
public class HttpSessionSecurityCookieFilter extends AbstractHttpSessionSecurityCookieFilter {
4145

gwtp-core/gwtp-dispatch-rpc-server-guice/src/main/java/com/gwtplatform/dispatch/server/guice/HttpSessionSecurityCookieFilter.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
* <p/>
3838
* You also have to use a {@code .jsp} file instead of a {@code .html} as your main GWT file.
3939
*
40-
* @deprecated Please use {@link com.gwtplatform.dispatch.rpc.server.guice.HttpSessionSecurityCookieFilter}.
40+
* @deprecated Please use {@link com.gwtplatform.dispatch.rpc.server.guice.RandomSecurityCookieFilter}.
41+
* Using the JSESSIONID like this might let an XSS attacker hijack a session. See GitHub issue #484
4142
*/
4243
@Deprecated
4344
@Singleton

gwtp-core/gwtp-dispatch-rpc-server-spring/src/main/java/com/gwtplatform/dispatch/rpc/server/spring/HttpSessionSecurityCookieFilter.java

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323

2424
import com.gwtplatform.dispatch.rpc.server.AbstractHttpSessionSecurityCookieFilter;
2525

26+
/**
27+
* @deprecated Please use {@link com.gwtplatform.dispatch.rpc.server.spring.RandomSecurityCookieFilter}.
28+
* Using the JSESSIONID like this might let an XSS attacker hijack a session. See GitHub issue #484
29+
*/
30+
@Deprecated
2631
public class HttpSessionSecurityCookieFilter extends AbstractHttpSessionSecurityCookieFilter {
2732
public HttpSessionSecurityCookieFilter(String securityCookieName) {
2833
super(securityCookieName);

gwtp-core/gwtp-dispatch-rpc-server-spring/src/main/java/com/gwtplatform/dispatch/server/spring/HttpSessionSecurityCookieFilter.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
import com.gwtplatform.dispatch.server.AbstractHttpSessionSecurityCookieFilter;
2525

2626
/**
27-
* @deprecated Please use {@link com.gwtplatform.dispatch.rpc.server.spring.HttpSessionSecurityCookieFilter}.
27+
* @deprecated Please use {@link com.gwtplatform.dispatch.rpc.server.spring.RandomSecurityCookieFilter}.
28+
* Using the JSESSIONID like this might let an XSS attacker hijack a session. See GitHub issue #484
2829
*/
2930
@Deprecated
3031
public class HttpSessionSecurityCookieFilter extends AbstractHttpSessionSecurityCookieFilter {

gwtp-core/gwtp-dispatch-rpc-server/src/main/java/com/gwtplatform/dispatch/rpc/server/AbstractHttpSessionSecurityCookieFilter.java

+4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@
4040
* </pre>
4141
* <p/>
4242
* You also have to use a {@code .jsp} file instead of a {@code .html} as your main GWT file.
43+
*
44+
* @deprecated Please use {@link com.gwtplatform.dispatch.rpc.server.AbstractRandomSecurityCookieFilter}.
45+
* Using the JSESSIONID like this might let an XSS attacker hijack a session. See GitHub issue #484
4346
*/
47+
@Deprecated
4448
public abstract class AbstractHttpSessionSecurityCookieFilter implements Filter {
4549

4650
private final String securityCookieName;

gwtp-core/gwtp-dispatch-rpc-server/src/main/java/com/gwtplatform/dispatch/rpc/server/AbstractRandomSecurityCookieFilter.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232

3333
/**
3434
* This filter will automatically inject a security cookie inside the request the first time the page is loaded. This
35-
* security cookie is a simple randomly generated number, and might be slightly less secure than
36-
* {@link com.gwtplatform.dispatch.rpc.server.guice.HttpSessionSecurityCookieFilter}, although it will work even if you
37-
* don't have access to an {@link javax.servlet.http.HttpSession}. To setup this filter, add the following line at
35+
* security cookie is a simple randomly generated number. To setup this filter, add the following line
3836
* before any other {@code serve} call in your own {@link com.google.inject.servlet.ServletModule#configureServlets}:
3937
* <p/>
4038
* <pre>

gwtp-core/gwtp-dispatch-rpc-server/src/main/java/com/gwtplatform/dispatch/server/AbstractHttpSessionSecurityCookieFilter.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
* <p/>
4242
* You also have to use a {@code .jsp} file instead of a {@code .html} as your main GWT file.
4343
*
44-
* @deprecated Please use {@link com.gwtplatform.dispatch.rpc.server.AbstractHttpSessionSecurityCookieFilter}.
44+
* @deprecated Please use {@link com.gwtplatform.dispatch.rpc.server.AbstractRandomSecurityCookieFilter}.
45+
* Using the JSESSIONID like this might let an XSS attacker hijack a session. See GitHub issue #484
4546
*/
4647
@Deprecated
4748
public abstract class AbstractHttpSessionSecurityCookieFilter implements Filter {

0 commit comments

Comments
 (0)