gpt4 book ai didi

coldfusion - 目前的 CF9.02 session Cookie 管理最佳实践是什么?

转载 作者:行者123 更新时间:2023-12-02 20:25:33 24 4
gpt4 key购买 nike

ColdFusion cookie session cookie 管理的常见“最佳实践”是实现如下内容:

<cfset this.setClientCookies = false />
<cfif NOT IsDefined( "cookie.cfid" ) OR NOT IsDefined( "cookie.cftoken" )>
<cfcookie name="cfid" value="#session.cfid#" domain=".#cgi.HTTP_HOST#" path="/test/sessiontest">
<cfcookie name="cftoken" value="#session.cftoken#" domain=".#cgi.HTTP_HOST#" path="/test/sessiontest">
</cfif>

或者

<cfif IsDefined("Cookie.CFID") AND IsDefined("Cookie.CFTOKEN")>
<cfcookie name="CFID" value="#Cookie.CFID#">
<cfcookie name="CFTOKEN" value="#Cookie.CFTOKEN#">
</cfif>

取决于你与谁交谈。

Adobe 随后发布了 http://www.adobe.com/support/security/bulletins/apsb11-04.html后来对此原始修复进行了修复,此处讨论:http://www.shilpikhariwal.com/2011/03/update-on-security-hot-fix-feb-2011.html

原始修复会导致此处描述的许多问题:http://cfsimplicity.com/4/coldfusion-security-hotfix-changes-session-behaviour此修复程序(以及网络上的许多其他类似修复程序)通过修改上面的 cfcookie 代码来工作。

一年后,我想知道人们当前在运行 CF9.02 时正在做什么 CFID/CFToken 管理(即应用了 session 固定修复)。

最佳答案

嗯,不使用 CFID/CFToken。我已经很多年没有使用这些客户端变量了,而是使用 ColdFusion session 管理。信任来自客户的信息风险太大(在我看来)。

Adobe 文档实际上有一篇关于管理客户端状态的非常好的文章:Managing the client state

您在什么情况下仍需要使用 CFID/CFToken?

摘自该 Adob​​e 文章:

A hacker who has the user’s CFToken and CFID cookies could gain access to user data by accessing a web page during the user’s session using the stolen CFToken and CFID cookies. While this scenario is unlikely, it is theoretically possible.

You can remove this vulnerability by selecting the Use J2EE Session Variables option on the ColdFusion Administrator Memory Variables page. The J2EE session management mechanism creates a new session identifier for each session, and does not use either the CFToken or the CFID cookie value.

关于coldfusion - 目前的 CF9.02 session Cookie 管理最佳实践是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12397599/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com