1

我正在使用 Apache Ignite 来集群 Web 会话,并使用 Spring 安全性来执行基于表单的身份验证。我使用的软件是:

  • JDK 1.8.0_60
  • Apache Tomcat 7.0.68
  • Apache Ignite 1.5.0.final
  • Spring Security 3.1.3.RELEASE

(没有 Apache Ignite,基于表单的身份验证可以正常工作,并且 JSESSIONID cookie 在身份验证成功时更改,以防止会话固定攻击,正如预期的那样。)

使用 Apache Ignite,我无法登录,并且收到以下警告:

2016-04-18 16:49:07,283 WARN  org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy/onAuthentication 102 - Your servlet container did not change the session ID when a new session was created. You will not be adequately protected against session-fixation attacks

如果我在 Spring 配置中关闭会话固定保护,如下所示:

<http>
    ...
    <session-management session-fixation-protection="none" />
    ...
</http>

有用。(但是,因此,JSESSIONID cookie 在身份验证成功后不会更改。)

4

2 回答 2

1

按照 Valentin 的建议(谢谢),我尝试了 Apache Ignite 的夜间构建,版本为 1.6.0-SNAPSHOT#20160419-sha1:186c8604。确实,它有效。

它适用于以下 Spring 安全配置:

<http>
    ...
    <session-management session-fixation-protection="none" />
    ...
</http>

当然,JSESSIONID cookie 在 Spring 安全认证成功后不会改变。

然后我注释掉下面的配置:

<session-management session-fixation-protection="none" />

它也有效。并且在身份验证成功后,JSESSIONID cookie 会按预期进行更改。

好的,我现在将使用 Ignite 版本 1.5.0.final(没有会话固定保护),并等待版本 1.6.x 的发布。

于 2016-04-19T11:56:34.853 回答
0

Tomcat 7 具有用于会话固定的内置功能,

  • 更改身份验证时的 jsessionid 以完全防止会话固定攻击

Tomcat 不允许应用程序更改会话 ID。

于 2016-04-19T00:32:04.843 回答