Skip to content

Commit 8bdec18

Browse files
committed
🔒️ fix CVE-2012-6708
1 parent c70c7ba commit 8bdec18

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ var jQuery = window.jQuery = window.$ = function( selector, context ) {
2121

2222
// A simple way to check for HTML strings or ID strings
2323
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
24-
var quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
24+
// Strict HTML recognition (#11290: must start with <)
25+
var quickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
2526

2627
// Is it a simple selector
2728
isSimple = /^.[^:#\[\.]*$/,

0 commit comments

Comments
 (0)