Skip to content

Instantly share code, notes, and snippets.

mala mala

Block or report user

Report or block mala

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mala
mala / jq_quickpatch.html
Created Jun 26, 2011 — forked from anonymous/jq_quickpatch.html
quick patch for jQuery selector XSS
View jq_quickpatch.html
<script type="text/javascript">
// http://ma.la/jquery_xss/
(function($){
var _init = $.fn.init;
$.fn.init = function(selector, context, rootjQuery){
// note: only block "#<img>", "a[href=<img onerror=...>]" still work.
if( typeof arguments[ 0 ] == "string" && /^#.*</.test( arguments[ 0 ] ) ){
throw new Error( "selector error" );
}
// console.log(arguments[0]);
You can’t perform that action at this time.