Jump to content

[SOLVED] need help with header injection


darkfreaks

Recommended Posts

it doesn't redirect to a page this is retarded whoever designed this to display the error on the same page through the header here is the code....

<?php
//the error part is unsafe even if i take itout and put the //whole error in a $variable 
//and urlencode it.
header("Location: $base_url/login.php?game=
$game&error=Error+logging+in.+Have+you+created
+an+account+yet?+Passwords+are+caSe+SEnsITIvE.");?>

 

 

 

Link to comment
Share on other sites

No, we need to see how the script login.php is using $_GET['error']. That's where the problem is, not how you're setting it. The problem is that the script is trusting that $_GET['error'] will always be only those strings it knows about.

 

Never trust user input

 

At minimum, you should be using the strip_tags before sending the value of $_GET['error'] to the screen.

 

Ken

 

 

Link to comment
Share on other sites

there is no $_GET['error'] it is all passed through this function

 

<?php

function error($page,$error = "")
{
include "globals.inc.php";
if (ereg("\?",$page))
{
	$string = "Location: $page&error=" . space2plus($error);// turn + to spaces
}
else
{
	$string = "Location: $page?error=" . space2plus($error);// turn + to spaces
}
return $string;
}?>

Link to comment
Share on other sites

No.

 

Somewhere in the script login.php it is sending the value for $_GET['error'] to the screen.

 

If there is no $_GET['error'] then your scripts are relying on register_globals being enabled which is another security problem.

 

Instead of posting snippets of the script that don't relate to the problem, just post the entire script.

 

Ken

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.