Author Topic: Tutorials Site  (Read 4079 times)

0 Members and 1 Guest are viewing this topic.

Offline Chat

  • Irregular
  • Posts: 28
  • Gender: Male
    • View Profile
    • Chat
Re: Tutorials Site
« Reply #15 on: April 13, 2007, 01:09:01 PM »
i was not aware of this unrestricted includes folder.

anyway, i can't seem to access the raw php still. i tried saving the file but my silly library computer is messing me around. can you paste the php code in this thread?

Offline obsidian

  • Managed Insanity
  • Staff Alumni
  • Freak!
  • *
  • Posts: 6,440
  • Gender: Male
  • Talk to me, I won't bite... hard.
    • View Profile
    • Guahan Web
Re: Tutorials Site
« Reply #16 on: April 13, 2007, 01:16:53 PM »
anyway, i can't seem to access the raw php still. i tried saving the file but my silly library computer is messing me around.

That's just it. Because it is PHP, you cannot access the raw code through a browser. You would have to have the author share the code with you (like you've asked).
You can't win, you can't lose, you can't break even... you can't even get out of the game.

Code: [Select]
<?php
while (count($life->getQuestions()) > 0)
{   
$life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

Offline .DarkmanTopic starter

  • Enthusiast
  • Posts: 101
    • View Profile
Re: Tutorials Site
« Reply #17 on: April 13, 2007, 10:14:28 PM »
Quote
I think that you've done a pretty good job overall, but it's hard to say without seeing the result of my submission Wink

I tried to put some different types of things in to see what I could get away with, and I was able to submit some different characters and things that could leave you XSS vulnerable, but I didn't go that far.
Oh ! Thanks for pointing me out.
I thought of cleaning up the text off tags. But then i ignored it because i'll be able to accept or reject tutorials before they show on their site.

For eg, i looked at your submission. I deleted it.

So do you say that i should strip the Description off tags ?


Thanks,

Offline obsidian

  • Managed Insanity
  • Staff Alumni
  • Freak!
  • *
  • Posts: 6,440
  • Gender: Male
  • Talk to me, I won't bite... hard.
    • View Profile
    • Guahan Web
Re: Tutorials Site
« Reply #18 on: April 14, 2007, 09:30:01 AM »
For eg, i looked at your submission. I deleted it.

So do you say that i should strip the Description off tags ?

It's totally up to you, but here's the thing: if the javascript I entered into the description actually showed a popup when you reviewed my submission, if I were mean, I could have taken that to the next level and used the javascript that would run to send your PHPSESSID to myself. If I have that, I could have then used your cookie to log in as you (hypothetically). While I'm oversimplifying things for the sake of argument here, the threat is very real. Any time you have client script running that you did not right (especially in an admin panel), it can be very dangerous.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

Code: [Select]
<?php
while (count($life->getQuestions()) > 0)
{   
$life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

Offline .DarkmanTopic starter

  • Enthusiast
  • Posts: 101
    • View Profile
Re: Tutorials Site
« Reply #19 on: April 14, 2007, 09:34:06 AM »
For eg, i looked at your submission. I deleted it.

So do you say that i should strip the Description off tags ?

It's totally up to you, but here's the thing: if the javascript I entered into the description actually showed a popup when you reviewed my submission, if I were mean, I could have taken that to the next level and used the javascript that would run to send your PHPSESSID to myself. If I have that, I could have then used your cookie to log in as you (hypothetically). While I'm oversimplifying things for the sake of argument here, the threat is very real. Any time you have client script running that you did not right (especially in an admin panel), it can be very dangerous.

Very True.
So, will it be okay if use the following code before submitting information into the database,
Code: [Select]
$description = strip_tags($description);

Offline obsidian

  • Managed Insanity
  • Staff Alumni
  • Freak!
  • *
  • Posts: 6,440
  • Gender: Male
  • Talk to me, I won't bite... hard.
    • View Profile
    • Guahan Web
Re: Tutorials Site
« Reply #20 on: April 14, 2007, 09:41:41 AM »
Very True.
So, will it be okay if use the following code before submitting information into the database,
Code: [Select]
$description = strip_tags($description);

Yes, however, you may wish to give your submitters some limited HTML to spice up the descriptions. If so, just use the optional second parameter with strip_tags():
Code: [Select]
<?php
$description 
strip_tags($description"b i u strong em");
?>


Good luck!
You can't win, you can't lose, you can't break even... you can't even get out of the game.

Code: [Select]
<?php
while (count($life->getQuestions()) > 0)
{   
$life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

Offline .DarkmanTopic starter

  • Enthusiast
  • Posts: 101
    • View Profile
Re: Tutorials Site
« Reply #21 on: April 14, 2007, 09:45:26 AM »
Thanks a lot for your help. Even those HTML would spoil the look. So i'll strip all the tags.


Thanks,