Created
June 24, 2011 15:05
-
-
Save anonymous/1044967 to your computer and use it in GitHub Desktop.
quick patch for jQuery selector XSS
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
<script type="text/javascript"> | |
// http://ma.la/jquery_xss/ | |
var _$=$; | |
$=function(){ | |
if( typeof arguments[ 0 ] == "string" && /^#.*</.test( arguments[ 0 ] ) ){ | |
throw new Error( "selector error" ); | |
} | |
return _$.apply( this, arguments ); | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment