Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.10.01 - All Issues
Author Message
utssace
Worker
Worker



Joined: Feb 18, 2006
Posts: 155
Location: Virginia

PostPosted: Sun Nov 11, 2007 2:08 pm Reply with quote

Is it ok to add this to the top of the .htaccess file in the nuke root?

Code:
php_value register_globals 0
 
View user's profile Send private message Visit poster's website
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Sun Nov 11, 2007 5:01 pm Reply with quote

Hummm ... I doubt it. Much of the Nuke "native" code depends on having register_globals on. I am just learning about all this but my understanding is:

-if you were writing a system from scratch you'd have it off and code with the knowledge that it was off
-but Nuke wasn't written that way and a lot of the programs depend on it

I also don't know if that would work in .htaccess but that's a separate issue.

Have you tried any experiments using this? What are you trying to do -- I mean where did you get the idea to do this? I'm really just curious for my own understanding.
 
View user's profile Send private message Visit poster's website
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Sun Nov 11, 2007 7:35 pm Reply with quote

Actually phpNuke works just fine with register_globals off. It will go ahead and call the function to mimic register_global's functionality - import_request_variables

I personally turn off register_globals unless a script requires it.

_________________
- Only registered users can see links on this board! Get registered or login! -

Need help? Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
fkelly







PostPosted: Mon Nov 12, 2007 9:35 am Reply with quote

Just to further my understanding I looked this up in mainfile.php. The code Evaders (I think) is referring to is:

Code:
if (!ini_get('register_globals')) {

    @import_request_variables('GPC', '');
}


So at least within Nuke system I'm not sure whether fiddling with htaccess the way that was originally proposed in this thread has any advantage. In a lot of the code in Nuke you'll have a form with, say a field called "foo" and then the form will be passed to the action script where the script will just access the variable $foo without doing an explicit $_POST['foo'] on it and with very little if any validation. From a maintainability point of view, as well as for security, it would be much better to explicitly retrieve variables from the $_POST array.
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Mon Nov 12, 2007 7:36 pm Reply with quote

It helps only if you also desire to have other non-nuke scripts on your server. Anything below the root will pick up the fact that register globals is off. Therefore, IMO, it doesn't hurt and can actually add a little bit of "security"... notice I said "little bit"????? Wink

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
utssace







PostPosted: Tue Nov 13, 2007 5:06 pm Reply with quote

So will the htaccess entry i listed above work for this? I tried this on a
joomla site that I was playing around with and it worked. Just not
sure.
 
fkelly







PostPosted: Tue Nov 13, 2007 6:16 pm Reply with quote

I think the consensus is:

1. it is irrelevant within Nuke, as long as mainfile is called you will have the effect of having register globals on.

2. you could have some "little bit" of additional security if you are not using Nuke and this works.

I have not tried the specific htaccess command. Maybe someone else knows off the top.

To test it, just write a form. It just has to have one input field and an action to another program (php). Say the input field is "foobar". In the program that processes the form try to access the input field as $foobar without doing a $_POST['foobar']. If you can access it then the htaccess command didn't work. If you can't it did. Unless, of course, your php.ini turned register globals off in the first place. In that case your htaccess command is duplicative and irrelevant.
 
montego







PostPosted: Tue Nov 13, 2007 7:16 pm Reply with quote

utssace, the best way to test is put that line in your .htaccess and then create a file with whatever name you want with a .php extension with the following:

Code:


<?php
phpinfo();
?>


And then run that from wherever you want on your server underneath that .htaccess file. Look to see if the register globals for local settings is OFF.

Do NOT post the results of that script here!!!!!! It is very sensitive info and delete the file once you have the output.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> RN v2.10.01 - All Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©