Misanthrope Posted June 15, 2009 Share Posted June 15, 2009 I'm using a very basic php switch right now, and it's only real purpose is navigation. However, just glancing at it told me it was vulnerable to RFI. Here is the switch in it's current form: <?php switch($id) { default: include('index.html'); break; case"id1":include('id1.html'); break; case"id2":include('id2.html'); break; case"id3":include('id3.htm'); break; case"id4":include('id4.htm'); break; case"id5":include('id5.htm'); } ?> Is there any way to make it secure without having to scrap it and replace it with something needlessly bloated with features I don't need? And yes, I suck when it comes to security. Quote Link to comment https://forums.phpfreaks.com/topic/162296-solved-making-my-php-switch-secure/ Share on other sites More sharing options...
MadTechie Posted June 15, 2009 Share Posted June 15, 2009 How is that vulnerable to RFI ? your pages are hard coded! Quote Link to comment https://forums.phpfreaks.com/topic/162296-solved-making-my-php-switch-secure/#findComment-856600 Share on other sites More sharing options...
Misanthrope Posted June 15, 2009 Author Share Posted June 15, 2009 How is that vulnerable to RFI ? your pages are hard coded! Someone attempted RFI and screwed up my site the other day, and ended up with the switch directing to an offsite script. EDIT: Found the problem was in fact in another script that allowed the attacker enough access to mess with the switch. Fixed up that exploit and so don't expect any more problems. My mistake Quote Link to comment https://forums.phpfreaks.com/topic/162296-solved-making-my-php-switch-secure/#findComment-856616 Share on other sites More sharing options...
MadTechie Posted June 15, 2009 Share Posted June 15, 2009 lol, its always the last place you look can you click topic solved bottom left Quote Link to comment https://forums.phpfreaks.com/topic/162296-solved-making-my-php-switch-secure/#findComment-856619 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.