PHP fopen() and file() CRLF injection
| php-fopen-crlf-injection (10080) |
Description:
PHP could allow a remote attacker to create fake HTTP headers by injecting CRLF (Carriage Return - Line Feed) combinations into HTTP headers using a specially-crafted URL request. This is caused by an input validation vulnerability in the fopen() function, the file() function, and possibly other functions that can occur, if the "allow_url_fopen()" directive is enabled. An attacker could use this vulnerability to redirect user's to the wrong Web site, initiate file downloads, and possibly turn affected PHP scripts into a proxy server and open mail relay.
Platforms Affected:
- Debian, Debian Linux 2.2
- Debian, Debian Linux 3.0
- PHP, PHP 4.2.1
- PHP, PHP 4.2.2
- PHP, PHP 4.2.3
- Various vendors, Any Web server
Remedy:
Apply the patch for this vulnerability, as listed in BugTraq Mailing List, Thu Sep 12 2002 - 11:32:36 CDT. See References.
For Debian GNU/Linux:
Upgrade to the latest PHP3 or PHP4 package, as listed below. Refer to DSA-168-1 for more information. See References.
Debian GNU/Linux 2.2 (potato) for PHP3: 3.0.18-0potato1.2 or later
Debian GNU/Linux 2.2 (potato) for PHP4: 4.0.3pl1-0potato4 or later
Debian GNU/Linux 3.0 (woody) for PHP3: 3.0.18-23.1woody1 or later
Debian GNU/Linux 3.0 (woody) for PHP4: 4.1.2-5 or later
—OR—
As a workaround, disable QUOT;allow_url_fopen" in php.ini until an upgrade or patch becomes available.
Consequences:
Bypass Security
References:
- BugTraq Mailing List, Mon May 06 2002 - 17:12:10 CDT, CRLF Injection at http://archives.neohapsis.com/archives/bugtraq/2002-05/0048.html.
- BugTraq Mailing List, Mon Sep 09 2002 - 16:23:01 CDT , PHP fopen() CRLF Injection at http://archives.neohapsis.com/archives/bugtraq/2002-09/0086.html.
- BugTraq Mailing List, Thu Sep 12 2002 - 11:32:36 CDT, Re: PHP fopen() CRLF Injection at http://archives.neohapsis.com/archives/bugtraq/2002-09/0132.html.
- PHP Group Web site, PHP: Hypertext Preprocessor at http://www.php.net/.
- BID-5681: PHP Function CRLF Injection Vulnerability
- CVE-2002-1783: CRLF injection vulnerability in PHP 4.2.1 through 4.2.3, when allow_url_fopen is enabled, allows remote attackers to modify HTTP headers for outgoing requests by causing CRLF sequences to be injected into arguments that are passed to the (1) fopen or (2) file functions.
- DSA-168: php -- bypassing safe_mode
Reported:
Sep 09, 2002
The information within this database may change without notice. Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. In no event shall the author/distributor (Internet Security Systems X-Force) be held liable for any damages whatsoever arising out of or in connection with the use or spread of this information.
Copyright (c) 1994-2008 Internet Security Systems, Inc. All rights reserved worldwide.
For corrections or additions please email xforce@iss.net
