TalkPHP
 
 
Account Login
Latest Articles
» cURL Basics
» Securing your PHP applications Part 1
» The way the function rolls
» Database Abstraction with Zend_Db - Part 2
» CSRF POST Token Protection
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP SurfnLearn
Reply
 
LinkBack Thread Tools Display Modes
Old 05-09-2008, 07:29 PM   #1 (permalink)
The Acquainted
 
drewbee's Avatar
 
Join Date: May 2008
Posts: 103
Thanks: 7
drewbee is on a distinguished road
Default $_SERVER['REQUEST_URI'] ... Server or header generated?

Hello all,

I use a database instead of sessions to keep information about a user. One of my columns tracks the current page that the user is on, and it is simply an update to the table setting the value with $_SERVER['REQUEST_URI']. I have been seeing some strange urls in there lately, IE Welcome to Intel.

I thought request uri was generated by the server, and pays no attention to the given header information.

One of two things are happening here:
1) I have a breach in my code somewhere, which I don't see how is possible since this code never touches user input.
2) request_uri is sent by the header and is being modified.

Does anyone have any information or tips about this?
Send a message via AIM to drewbee
drewbee is offline  
Reply With Quote
Old 05-09-2008, 07:58 PM   #2 (permalink)
The Frequenter
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas
Posts: 437
Thanks: 13
delayedinsanity is on a distinguished road
Default

I'm not sure the semantics of REQUEST_URI or if it's easy enough to spoof, but if you're having troubles with it, you could try using PHP_SELF. I've never personally ran into troubles with REQUEST_URI being incorrect, but I also haven't ran any high traffic sites.
-m
delayedinsanity is offline  
Reply With Quote
Old 05-12-2008, 05:34 PM   #3 (permalink)
The Acquainted
 
wGEric's Avatar
 
Join Date: Nov 2007
Posts: 123
Thanks: 0
wGEric is on a distinguished road
Default

Isn't REQUEST_URI the URI the browser is requesting so it would be sent by the browser?
__________________
Eric
BlogphpBB
wGEric is offline  
Reply With Quote
Old 05-12-2008, 08:39 PM   #4 (permalink)
The Acquainted
 
drewbee's Avatar
 
Join Date: May 2008
Posts: 103
Thanks: 7
drewbee is on a distinguished road
Default

Quote:
Originally Posted by wGEric View Post
Isn't REQUEST_URI the URI the browser is requesting so it would be sent by the browser?

Thats what I am trying to figure out. I am a little suprised that it would be this way though coming from the server global variable. But then again, HTTP_REFERER, REQUEST_METHOD, HTTP_USER_AGENT are all set by the browser, so it may very well be.

I just found it interesting that looking through my current list of 'whos online locations, I had several full address urls that have no relation to mine whatsoever. Looks like I may just start defining a variable that describes the page, that way it isn't server generated.
Send a message via AIM to drewbee
drewbee is offline  
Reply With Quote
Old 05-17-2008, 07:58 PM   #5 (permalink)
The Wanderer
 
Join Date: Sep 2007
Posts: 12
Thanks: 0
Izym is on a distinguished road
Default

As far as I know it's the URI requested by the browser, as it changes along with the address you type in (which is the URI).
Izym is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 05:34 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0