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

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

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

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

            PHP Misconfiguration: allow_url_fopen Enabled

            ABSTRACT

            對遠程文件進行操作可能會讓攻擊者將惡意內容注入到程序中。

            EXPLANATION

            如果啟用 allow_url_fopen 選項,就可以通過 HTTP 或 FTP URL 在遠程文件上執行接受文件名的 PHP 函數。該選項是在 PHP 4.0.4 中引入的,并且默認情況下是啟用的,由于它可能會導致攻擊者將惡意內容引入程序中,因此具有危險性。最理想的情況是,攻擊者篡改了遠程文件來引入到惡意內容,因此對遠程文件進行操作導致應用程序容易受到攻擊。最糟糕的情況是,攻擊者控制了運行應用程序的 URL,這樣一來,攻擊者就可以將一個 URL 提供給遠程服務器,從而可以將任意惡意內容注入到應用程序中。

            例 1:以下代碼可打開一個文件并讀取其內容,文件名由一個請求參數控制。由于 $file 的值由一個請求參數控制,因此攻擊者有可能違背程序員的假設,將一個 URL 提供給遠程文件。


            <?php
            $file = fopen ($_GET["file"], "r");
            if (!$file) {
            // handle errors
            }
            while (!feof ($file)) {
            $line = fgets ($file, 1024);
            // operate on file content
            }
            fclose($file);
            ?>

            REFERENCES

            [1] Standards Mapping - OWASP Top 10 2004 - (OWASP 2004) A10 Insecure Configuration Management

            [2] Standards Mapping - OWASP Top 10 2010 - (OWASP 2010) A6 Security Misconfiguration

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

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

            [5] Standards Mapping - FIPS200 - (FISMA) CM

            [6] Standards Mapping - Common Weakness Enumeration - (CWE) CWE ID 94

            [7] M. Achour et al. PHP Manual

            [8] PHP Security Consortium PhpSecInfo Test Information

            [9] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 - (PCI 1.1) Requirement 6.5.10

            [10] Standards Mapping - SANS Top 25 2009 - (SANS 2009) Risky Resource Management - CWE ID 094


            Copyright 2013 Fortify Software - All rights reserved.
            (Generated from version 2013.1.1.0008 of the Fortify Secure Coding Rulepacks)
            desc.config.php.php_misconfiguration_allow_url_fopen

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

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

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

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

                      亚洲欧美在线