skin xss

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
MarcoP
Posts: 46
Joined: Wed Mar 24, 2010 1:46 pm

skin xss

Post by MarcoP »

index.php?skin=<script>alert('ciao');</script>
whatboy
Posts: 304
Joined: Mon Aug 31, 2009 10:31 pm

Post by whatboy »

Looks like you miss something???
MarcoP
Posts: 46
Joined: Wed Mar 24, 2010 1:46 pm

Post by MarcoP »

I'm not missing anything ;)

in index.php line 63, for additional security,

change

Code: Select all

if ( isset($_GET['skin']) )
    $skin = $_GET['skin'];
elseif ( isset($_COOKIE['zmSkin']) )
    $skin = $_COOKIE['zmSkin'];
else
    $skin = "classic";
to

Code: Select all

if ( isset($_GET['skin']) && preg_match('#^[a-z]+$#', $_GET['skin']))
    $skin = $_GET['skin'];
elseif ( isset($_COOKIE['zmSkin']) && preg_match('#^[a-z]+$#', $_COOKIE['zmSkin']) )
    $skin = $_COOKIE['zmSkin'];
else
    $skin = "classic";
whatboy
Posts: 304
Joined: Mon Aug 31, 2009 10:31 pm

Post by whatboy »

Told ya you miss something... you miss that I didn't understood a thing... now seems clearer!!! :P
Post Reply