<span id="7ztzv"></span>
<sub id="7ztzv"></sub>

<span id="7ztzv"></span><form id="7ztzv"></form>

<span id="7ztzv"></span>

        <address id="7ztzv"></address>

            Cross-Site Request Forgery

            ABSTRACT

            表單發布必須包含用戶特有的機密,防止攻擊者發出未經授權的請求。

            EXPLANATION

            跨站點偽裝請求 (CSRF) 漏洞會在以下情況下發生:
            1. Web 應用程序使用會話 cookie。

            2. 應用程序未驗證請求是否經過用戶同意便處理 HTTP 請求。



            如果該請求未包含證明其來源的 nonce,則處理該請求的代碼將易受到 CSRF 攻擊(除非它并未更改應用程序的狀態)。這意味著使用會話 cookie 的 Web 應用程序必須采取特殊的預防措施,確保攻擊者無法誘騙用戶提交偽請求。假設有一個 Web 應用程序,它允許管理員通過提交此表單來創建新帳戶:


            <form method="POST" action="/new_user" >
            Name of new user:<input type="text" name="username">
            Password for new user:<input type="password" name="user_passwd">
            <input type="submit" name="action" value="Create User">
            </form>


            攻擊者可能會使用以下內容來建立一個網站:


            <form method="POST" action="http://www.example.com/new_user">
            <input type="hidden" name="username" value="hacker">
            <input type="hidden" name="user_passwd" value="hacked">
            </form>
            <script>
            document.usr_form.submit();
            </script>


            如果 example.com 網站的管理員在網站上具有活動會話時訪問了此惡意頁面,則她會在毫不知情的情況下為攻擊者創建一個帳戶。這就是 CSRF 攻擊。正是由于該應用程序無法確定請求的來源,才有可能受到 CSRF 攻擊。任何請求都有可能是用戶選定的合法操作,也有可能是攻擊者設置的偽操作。攻擊者無法查看偽請求生成的網頁,因此,這種攻擊技術僅適用于篡改應用程序狀態的請求。

            大多數 Web 瀏覽器會隨每次請求發送一個名為 referer 的 HTTP 頭文件。referer 頭文件應該包含參考頁面的 URL,但攻擊者可以偽造,因此無法利用 referer 頭文件確定請求的來源。

            如果應用程序通過 URL 傳遞會話標識符(而不是 cookie),則不會出現 CSRF 問題,因為攻擊者無法訪問會話標識符,也無法在偽請求中包含會話標識符。

            CSRF 在 2007 OWASP Top 10 排行榜上名列第 5。

            REFERENCES

            [1] OWASP 2007 OWASP Top 10

            [2] Standards Mapping - OWASP Top 10 2007 - (OWASP 2007) A5 Cross Site Request Forgery (CSRF)

            [3] Standards Mapping - OWASP Top 10 2010 - (OWASP 2010) A5 Cross-Site Request Forgery (CSRF)

            [4] Standards Mapping - Security Technical Implementation Guide Version 3 - (STIG 3) APP3585 CAT II

            [5] Standards Mapping - Security Technical Implementation Guide Version 3.4 - (STIG 3.4) APP3585 CAT II

            [6] Standards Mapping - Web Application Security Consortium 24 + 2 - (WASC 24 + 2) Cross-Site Request Forgery

            [7] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 352

            [8] A. Klein Divide and Conquer:HTTP Response Splitting, Web Cache Poisoning Attacks, and Related Topics

            [9] Standards Mapping - SANS Top 25 2009 - (SANS 2009) Insecure Interaction - CWE ID 352

            [10] Standards Mapping - SANS Top 25 2010 - (SANS 2010) Insecure Interaction - CWE ID 352

            [11] Standards Mapping - SANS Top 25 2011 - (SANS Top 25 2011) Insecure Interaction - CWE ID 352

            [12] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 - (PCI 1.2) Requirement 6.5.5

            [13] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 - (PCI 2.0) Requirement 6.5.9


            Copyright 2013 Fortify Software - All rights reserved.
            (Generated from version 2013.1.1.0008 of the Fortify Secure Coding Rulepacks)
            desc.content.html.csrf

            <span id="7ztzv"></span>
            <sub id="7ztzv"></sub>

            <span id="7ztzv"></span><form id="7ztzv"></form>

            <span id="7ztzv"></span>

                  <address id="7ztzv"></address>

                      亚洲欧美在线