青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

小默

Session cookies for web applications

Session cookies for web applications [http://lwn.net/Articles/283383/]
By Jake Edge
May 21, 2008

Two weeks ago on this page, we reported on some Wordpress vulnerabilities that were caused by incorrectly generating authentication cookies. The article was a bit light on details about such cookies, so this follow-up hopes to remedy that. In addition, Steven Murdoch, who discovered both of the holes, recently presented a paper on a new cookie technique that provides some additional safeguards over other schemes.

兩周前在此頁上,我們報道了由不正確生成的身份驗證 cookies 引起的一些 Wordpress 漏洞。那篇文檔對這些 cookies 的細節(jié)描述略少,這篇后續(xù)的文章希望能解決這個問題。另外,發(fā)現(xiàn)這些漏洞的 Steven Murdoch,最近發(fā)表了篇關(guān)于一種新的 cookie 技術(shù)的文章,文章提供了其他方案之`上`的一些額外保護措施。

HTTP is a stateless protocol which means that any application that wishes to track multiple requests as a single session must provide its own way to link those requests. This is typically done through cookies, which are opaque blobs of data that are stored by browsers. Cookies are sent to the browser as part of an HTTP response, usually after some kind of authentication is successful. The browser associates the cookie with the URL of the site so that it can send the cookie value back to the server on each subsequent request.

HTTP 是一種無狀態(tài)的協(xié)議,這意味著任何希望跟蹤多個請求作為單個會話的應(yīng)用程序,必須提供自己的方式來鏈接這些請求。這通常通過 cookies 來完成,cookies 是瀏覽器存儲的不透明的數(shù)據(jù)塊。通常,在某種身份認證成功后,cookies 被作為一個 HTTP 響應(yīng)的一部分發(fā)送給瀏覽器。瀏覽器把 cookie 和對應(yīng)網(wǎng)站的 URL 關(guān)聯(lián)起來,以便它可以在每個后續(xù)請求中回送 cookie 值到服務(wù)器。

Servers can then use the value as a key into some kind of persistent storage so that all requests that contain that cookie value are treated as belonging to a particular session. In particular, it represents that the user associated with that session has correctly authenticated. The cookie lasts until it expires or is deleted by the user. When that happens, the user must re-authenticate to get a new cookie which also starts a new session. Users find this annoying if it happens too frequently, so expirations are often quite long.

然后,服務(wù)器可以`用某種持久性存儲的鍵`使用該值,使得所有包含該 cookie 值的請求,被視為屬于同一個特定會話。特別是,它代表和該會話關(guān)聯(lián)的那個已經(jīng)正確通過身份驗證的用戶。一個 cookie 一直存在,直到過期或被用戶刪除。此時,用戶必須重新進行身份驗證,獲取一個新 cookie,同時開始一個新會話。如果它發(fā)生的過于頻繁,會讓用戶感到惱人,所以到期時間通常相當長。

If the user explicitly logs out of the application, any server-side resources that are being used to store state information can be freed, but that is often not the case. Users will generally just close their browser (or tab) while still being logged in. It is also convenient for users to be allowed multiple concurrent sessions, generally from multiple computers, which will cause the number of sessions stored to be larger, perhaps much larger, than the number of users.

如果用戶顯式地登出應(yīng)用程序,任何用來存儲狀態(tài)信息的服務(wù)器端資源會被釋放,但情況經(jīng)常不是這樣。用戶通常只是關(guān)閉他們的瀏覽器(或標簽頁),當仍在登錄狀態(tài)時。這也允許用戶方便地,從不同的計算機上使用多個并發(fā)會話。這將導致存儲更大的會話數(shù)量,也許比用戶數(shù)量大許多。

Applications could restrict the number of sessions allowed by a user, or ratchet the expiration value way down, but they typically do not for user convenience. This allows for a potential denial of service when an attacker creates so many sessions that the server runs out of persistent storage. For this reason, stateless session cookies [PDF][http://prisms.cs.umass.edu/~kevinfu/papers/webauth_tr.pdf] were created.

應(yīng)用程序可以限制允許一個用戶使用的會話數(shù),或者``,但它們通常不方便用戶使用。這允許一個潛在的拒絕服務(wù),當一個攻擊者創(chuàng)建太多會話,以至于服務(wù)器用完持久性存儲時。出于這個原因,無狀態(tài)會話 cookies 被創(chuàng)建。

Stateless session cookies store all of the state information in the cookie itself, so that the server need not keep anything in the database, filesystem, or memory. The data in the cookie must be encoded in such a way that they cannot be forged, otherwise attackers could create cookies that allow them access they should not have. This is essentially where Wordpress went wrong. By not implementing stateless session cookies correctly, a valid cookie for one user could be modified into a valid cookie for a different user.

無狀態(tài)會話 cookies 把所有狀態(tài)信息存儲到 cookie 本身,使服務(wù)器不需要在數(shù)據(jù)庫、文件系統(tǒng)或內(nèi)存中保存任何信息。Cookie 中的數(shù)據(jù)必須以不能被偽造的方式編碼,否則攻擊者可以創(chuàng)建允許他們訪問不應(yīng)該訪問內(nèi)容的 cookies 。實際上這就是 Wordpress 出問題的地方。由于沒有正確使用無狀態(tài)會話 cookies ,一個用戶的有效 cookie 可以被修改成另一個不同用戶的有效 cookie 。

A stateless session cookie has the state data and expiration "in the clear" followed by a secure hash (SHA-256 for example) of those same values along with a key known only by the server. When the server receives the cookie value, it can calculate the hash and if it matches, proceed to use the state information. Because the secret is not known, an attacker cannot create their own cookies with values of their choosing.

一個無狀態(tài)的會話 cookie 有狀態(tài)數(shù)據(jù)和明確的到期時間,后跟一個安全哈希值(例如 SHA-256),該哈希值和只有服務(wù)器知道的一個鍵`對應(yīng)`。當服務(wù)器接收到 cookie 值,會計算哈希值,如果匹配,繼續(xù)使用其中的狀態(tài)信息。由于這個密鑰是未知的,攻擊者不能使用他們選擇的值創(chuàng)建自己的 cookies 。

The other side of that coin is that an attacker can create spoofed cookies if they know the secret. Murdoch wanted to extend the concept such that even getting access to the secret, through a SQL injection or other web application flaw, would not feasibly allow an attacker to create a spoofed cookie. The result is hardened stateless session cookies [PDF][http://www.cl.cam.ac.uk/~sjm217/papers/protocols08cookies.pdf].

硬幣的另一面是,如果攻擊者知道密鑰,可以創(chuàng)建欺騙性的 cookies 。Murdoch 希望擴展概念,使得通過 SQL 注入或其它 web 應(yīng)用漏洞訪問密鑰后,攻擊者也無法創(chuàng)建一個欺騙性的 cookie。結(jié)果就是強化的無狀態(tài)會話 cookies 。

The basic idea behind the scheme is to add an additional field to stateless session cookies that corresponds to an authenticator generated when an account is first set up. This authenticator is generated from the password at account creation by iteratively calculating the cryptographic hash of the password and a long salt value.

該方案背后的基本思路是,給無狀態(tài)會話 cookie 增加一個額外的字段,這個字段和賬戶首次設(shè)置時生成的一個`身份驗證器`對應(yīng)。身份驗證器由創(chuàng)建賬戶時的密碼生成,生成方法是,迭代計算密碼的加密哈希和一個長 salt 值。

Salt is a random string—usually just a few characters long—that is added to a password before it gets hashed, then stored with the password in the clear. It is used to eliminate the use of rainbow tables to crack passwords. Hardened stateless session cookies use a 128-bit salt value, then repeatedly calculate HASH(prev|salt), where prev is the password the first time through and the hash value from the previous calculation on each subsequent iteration.

Salt 是一個隨機字符串——通常只有幾個字符長——它在被計算哈希值前添加到密碼中,然后以明文形式和密碼一起存儲。它是用來杜絕使用彩虹表破解密碼的。`硬化`的無狀態(tài)會話 cookies 使用128位 salt 值,然后迭代計算 HASH(prev|salt) , 其中 prev 在第一次迭代時是密碼,在以后每次迭代中是上次計算的 hash 值。

The number of iterations is large, 256 for example, but not a secret. Once that value is calculated, it is hashed one last time, without the salt, and then stored in the user table as the authenticator. When the cookie value is created after a successful authentication, only the output of the iterative hash itself is placed in the cookie, not the authenticator that is stored in the database. Cookie verification then must do the standard stateless session cookie hash verification, to ensure that the values have not been manipulated, then hash the value in the cookie to verify against authenticator in the database.

迭代次數(shù)是個大的值,例如256,但這不是保密的。值被計算出來后,再不使用 salt 哈希一次,然后作為身份驗證器存儲到用戶表中。當 cookie 通過一次成功認證被創(chuàng)建后,只有輸出的迭代哈希值被保存在 cookie 中,而不保存數(shù)據(jù)庫中的身份驗證器。Cookie 驗證必須進行標準的無狀態(tài)會話 cookie 哈希驗證,來確保值沒有被修改過,然后哈希 cookie 中的值和數(shù)據(jù)庫中的身份驗證器對比。

If it sounds complicated, it is; the performance of doing 256 hashes is also an issue, but it does protect against the secret key being lost. Because an attacker cannot calculate a valid authenticator value to put in the cookie (doing so would require breaking SHA-256), they cannot create their own spoofed cookies.

如果這聽起來很復雜,確實;進行256次哈希的性能也是一個問題,但它確實能避免密鑰丟失。因為攻擊者無法計算一個有效的用戶驗證器放進 cookie 中(這樣做需要突破 SHA-256),所以他們不能創(chuàng)建自己的欺騙 cookie 。

While it is not clear that the overhead of all of these hash calculations is warranted, it is an interesting extension to the stateless session cookie scheme. In his paper, Murdoch mentions some variations that could be used to further increase the security of the technique.

目前尚不清楚所有這些哈希計算的開銷是否有必要,這是一個擴展無狀態(tài)會話 cookie 的有趣方案。在他的文章中,Murdoch 提到了一些可以進一步提高該技術(shù)安全性的變化。


---
后面沒看明白。
無狀態(tài)會話 cookie 中的密鑰可能被攻擊者獲取,authenticator 為什么不能被攻擊者獲取?獲取這兩個東西的難度有區(qū)別么?

---
TODO
| hash salt
| 彩虹表

posted on 2011-10-09 07:14 小默 閱讀(407) 評論(0)  編輯 收藏 引用 所屬分類: Security

導航

統(tǒng)計

留言簿(13)

隨筆分類(287)

隨筆檔案(289)

漏洞

搜索

積分與排名

最新評論

閱讀排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美日韩在线视频首页| 欧美日韩国产精品自在自线| 一区二区日韩伦理片| 欧美午夜视频在线观看| 久久成人18免费网站| 亚洲视频每日更新| 在线亚洲国产精品网站| 国产主播精品| 欧美影院在线| 国产女精品视频网站免费| 国产精品一区二区女厕厕| 国产欧美日韩不卡| 国产亚洲在线| 亚洲精品欧美激情| 亚洲欧美在线免费观看| 久久男女视频| 亚洲黄一区二区| 亚洲最新中文字幕| 久久精品国产免费| 欧美日韩免费高清一区色橹橹| 国产精品久久久久久久app| 国产一区二区欧美| 亚洲麻豆av| 久久成人免费网| 91久久精品www人人做人人爽| 亚洲自拍电影| 欧美激情bt| 国模一区二区三区| 亚洲一区二区毛片| 欧美黄色一区| 亚洲综合视频网| 欧美精品在线观看一区二区| 国内精品久久久久久| 国产精品99久久久久久久久| 久久一区二区三区国产精品| 9色porny自拍视频一区二区| 免费视频亚洲| 狠狠色综合网| 久久久久国产免费免费| 一区二区国产精品| 欧美国产日本在线| 一区二区视频欧美| 久久av老司机精品网站导航| 艳女tv在线观看国产一区| 欧美一二三视频| 在线播放豆国产99亚洲| 亚洲欧美一区二区在线观看| 亚洲国产精品成人综合| 久久精品视频在线看| 国产毛片一区二区| 亚洲一二三区在线观看| 亚洲日本欧美| 欧美激情在线有限公司| 亚洲精品国产精品乱码不99按摩| 美腿丝袜亚洲色图| 久久精品卡一| 在线免费观看日本一区| 麻豆精品国产91久久久久久| 欧美在线1区| 国产欧美日本| 久久精品国产久精国产爱| 亚洲视频网在线直播| 欧美性猛交xxxx乱大交退制版| 一区二区三区 在线观看视频| 亚洲精品欧美极品| 欧美日韩高清在线| 国产精品99久久99久久久二8 | 蜜臀99久久精品久久久久久软件| 国产精品日韩电影| 久久成人综合网| 欧美在线视频不卡| 亚洲国产精品t66y| 亚洲国产日韩欧美在线动漫| 免费视频亚洲| 亚洲私人影院在线观看| 亚洲在线视频网站| 狠狠做深爱婷婷久久综合一区| 另类欧美日韩国产在线| 久久久精品性| 亚洲精品一级| 亚洲欧美日韩精品久久| 精久久久久久久久久久| 亚洲国产日韩一级| 国产精品久久久久久久久免费樱桃| 性做久久久久久免费观看欧美| 性欧美暴力猛交另类hd| 在线观看视频免费一区二区三区| 亚洲黑丝一区二区| 国产精品网站在线播放| 久久视频精品在线| 欧美激情第3页| 亚洲欧洲av一区二区三区久久| 欧美一级午夜免费电影| 一区三区视频| 日韩午夜剧场| 精品成人一区| 9久草视频在线视频精品| 在线播放国产一区中文字幕剧情欧美| 亚洲人成毛片在线播放| 国产亚洲人成网站在线观看| 亚洲韩国一区二区三区| 国产精品综合| 91久久久精品| 黄色日韩网站视频| 亚洲一区二区视频在线| 亚洲欧美中文另类| 久久精品一区二区国产| 亚洲一区在线播放| 美女免费视频一区| 欧美一区二区三区视频在线观看 | 在线亚洲一区观看| 精品盗摄一区二区三区| 99精品欧美一区| 亚洲第一色在线| 午夜精品理论片| 亚洲一区二区三区激情| 欧美福利精品| 男同欧美伦乱| 精品盗摄一区二区三区| 香港久久久电影| 亚洲欧美日韩精品一区二区| 欧美精品在线观看| 欧美激情一区二区三区不卡| 国产农村妇女毛片精品久久麻豆| 99综合视频| 亚洲午夜高清视频| 欧美日本国产一区| 亚洲激情校园春色| 亚洲国产综合91精品麻豆| 久久久久国产一区二区| 久久久久久穴| 黄色成人免费观看| 久久久www成人免费精品| 欧美激情一区二区三区蜜桃视频| 欧美日韩国产小视频| 亚洲一区二区3| 欧美女激情福利| 亚洲欧洲在线看| 亚洲免费成人| 欧美韩日一区二区| 亚洲人午夜精品免费| 亚洲精品亚洲人成人网| 欧美伦理影院| 亚洲视频axxx| 欧美一区二区三区在线| 国产欧美亚洲视频| 亚洲欧美一区二区三区极速播放| 欧美一区二区在线| 国产在线拍揄自揄视频不卡99| 性久久久久久久久久久久| 久久久久在线观看| 1000部国产精品成人观看 | 免费看的黄色欧美网站| 欧美承认网站| 亚洲免费大片| 国产精品裸体一区二区三区| 午夜亚洲福利| 免费精品视频| 99天天综合性| 国产精品免费在线| 久久精品噜噜噜成人av农村| 欧美不卡福利| 一本色道久久综合狠狠躁篇怎么玩| 欧美日韩小视频| 午夜久久一区| 欧美高清成人| 亚洲欧美日韩另类精品一区二区三区| 国产精品试看| 免费一级欧美片在线观看| 国产日产精品一区二区三区四区的观看方式 | 亚洲欧美国产精品va在线观看| 国产精品久久久久久久久借妻 | 亚洲激情专区| 亚洲欧美制服另类日韩| 在线观看国产精品网站| 欧美日韩精品免费观看视频完整| 亚洲欧美日韩一区在线| 欧美福利电影网| 亚洲欧美欧美一区二区三区| 亚洲第一视频| 国产欧美一区二区三区久久| 欧美freesex交免费视频| 亚洲在线网站| 亚洲最新合集| 亚洲国产欧美另类丝袜| 欧美中文字幕久久| 亚洲视屏一区| 亚洲精品日韩综合观看成人91| 国产精品推荐精品| 欧美日韩国产精品一区二区亚洲| 久久久国产一区二区| 在线视频欧美精品| 最新日韩中文字幕| 欧美成人一区二区在线| 性色av一区二区三区红粉影视| 日韩午夜三级在线| 最新亚洲一区| 精品电影在线观看| 国产一区二区在线观看免费| 国产精品视频区|