PHP fopen() and file() CRLF injection

php-fopen-crlf-injection (10080) The risk level is classified as MediumMedium Risk

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:

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

Return to the main page