|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19286 header() Control Char Injection
Submitted: 2002-09-07 16:14 UTC Modified: 2002-09-08 06:47 UTC
Avg. Score:3.3 ± 1.7
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mattmurphy at kc dot rr dot com Assigned:
Status: Wont fix Package: Output Control
PHP Version: 4.2.3 OS: Win32
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-09-07 16:14 UTC] mattmurphy at kc dot rr dot com
I made a quite primitive use of the header() function in a redirect script:

if (isset($_GET["url"])) {
header("Location: " . $_GET["url"]);

But, no imagine for a second:

Which causes:



Another interesting thing about this is that it (possibly) allows bypassing output buffering(?).

If nothing else, this is a documentation problem, as the header() docs say that it will modify a single header, but it also allows body content to be manipulated.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-07 21:44 UTC]
Have you ever thought of shooting yourself?
You can also pass user input to fopen()..or exect() (that's really for the brave ones to try..)

 [2002-09-07 21:46 UTC]
Document mentions variables must be checked before passing it  to header() already.

header() should be able to send multiple line header also.

 [2002-09-08 06:47 UTC]
BTW: Your little example does exactly nothing...

All Browsers I use (IE, Mozilla, Opera) ignore the body
if they find a Location header.

The only possible "danger" is Cookie injection.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 02 06:01:27 2023 UTC