Advisory: php-decoda: Cross-Site Scripting in Video Tags
Decoda is a lightweight class that extracts and parses a custom markup language; based on the concept of BB code. Decoda supports all the basic HTML tags and manages special features for making links and emails auto-clickable, using shorthand emails and links, and finally allowing the user to add their own code tags. Decoda supports a directive for videos. For example the Decoda markup [video="youtube" size="small"]test[/video] creates the following corresponding HTML code (whitespace adjusted): <iframe src="http://www.youtube.com/embed/test"; width="560" height="315" frameborder="0"></iframe>. The code to generate the iframe tag can be found in the following file: decoda/templates/video.php. There, the HTML tag is generated as follows: <?php if ($player == 'embed') { ?> <embed src="<?php echo $url; ?>" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="<?php echo $width; ?>" height="<?php echo $height; ?>"> <?php } else { ?> <iframe src="<?php echo $url; ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>" frameborder="0"></iframe> <?php } ?>. The problem is that the attributes of the iframe tag are not properly escaped. This allows attackers to specify a JavaScript event handler for the iframe tag.